Developer's Guide to Oracle Solaris Security

gss_str_to_oid() Function

For backward compatibility with earlier versions of the GSS-API, this implementation of the GSS-API supports the function gss_str_to_oid(). gss_str_to_oid() converts a string that represents a mechanism or QOP to an OID. The string can be either as a number or a word.


Caution – Caution –

gss_str_to_oid(), gss_oid_to_str(), and gss_release_oid() are not supported by some implementations of the GSS-API to discourage the use of explicit, non-default mechanisms and QOPs.


The mechanism string can be hard-coded in the application or come from user input. However, not all implementations of the GSS-API support gss_str_to_oid(), so applications should not rely on this function.

The number that represents a mechanism can have two different formats. The first format, { 1 2 3 4 }, is officially mandated by the GSS-API specifications. The second format, 1.2.3.4, is more widely used but is not an official standard format. gss_str_to_oid() expects the mechanism number in the first format, so you must convert the string if the string is in the second format before calling gss_str_to_oid(). An example of gss_str_to_oid() is shown in Example C–3. If the mechanism is not a valid one, gss_str_to_oid() returns GSS_S_BAD_MECH.

Because gss_str_to_oid() allocates GSS-API data space, the gss_release_oid() function exists is provided to remove the allocated OID when you are finished. Like gss_str_to_oid(), gss_release_oid() is not a generally supported function and should not be relied upon in programs that aspire to universal portability.