gss: make krb5 default GSS mech earlier in path
Defensively default to GSS_KRB5_MECHANISM on all calls to gss_init_sec_context() if mech_type is GSS_C_NO_OID (rather than only on the first call).
This commit is contained in:
@@ -173,6 +173,9 @@ gss_init_sec_context(OM_uint32 * minor_status,
|
|||||||
if (time_rec)
|
if (time_rec)
|
||||||
*time_rec = 0;
|
*time_rec = 0;
|
||||||
|
|
||||||
|
if (mech_type == GSS_C_NO_OID)
|
||||||
|
mech_type = GSS_KRB5_MECHANISM;
|
||||||
|
|
||||||
_gss_mg_check_name(target_name);
|
_gss_mg_check_name(target_name);
|
||||||
|
|
||||||
if (_gss_mg_log_level(1))
|
if (_gss_mg_log_level(1))
|
||||||
@@ -186,9 +189,6 @@ gss_init_sec_context(OM_uint32 * minor_status,
|
|||||||
* sure we use the same mechanism switch as before.
|
* sure we use the same mechanism switch as before.
|
||||||
*/
|
*/
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
if (mech_type == NULL)
|
|
||||||
mech_type = GSS_KRB5_MECHANISM;
|
|
||||||
|
|
||||||
ctx = malloc(sizeof(struct _gss_context));
|
ctx = malloc(sizeof(struct _gss_context));
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
*minor_status = ENOMEM;
|
*minor_status = ENOMEM;
|
||||||
|
Reference in New Issue
Block a user