More work on initial implementation
[mech_eap.git] / util_context.c
index daf65d6..7121d7f 100644 (file)
@@ -36,6 +36,7 @@ OM_uint32
 gssEapAllocContext(OM_uint32 *minor,
                    gss_ctx_id_t *pCtx)
 {
+    OM_uint32 tmpMinor;
     gss_ctx_id_t ctx;
 
     assert(*pCtx == GSS_C_NO_CONTEXT);
@@ -46,6 +47,12 @@ gssEapAllocContext(OM_uint32 *minor,
         return GSS_S_FAILURE;
     }
 
+    *minor = krb5_init_context(&ctx->kerberosCtx);
+    if (*minor != 0) {
+        gssEapReleaseContext(&tmpMinor, &ctx);
+        return GSS_S_FAILURE;
+    }
+
     *pCtx = ctx;
 
     return GSS_S_COMPLETE;