display_status: fix logic error
[mech_eap.orig] / import_sec_context.c
index 084ca87..cf46d6a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, JANET(UK)
+ * Copyright (c) 2011, JANET(UK)
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * SUCH DAMAGE.
  */
 
+/*
+ * Deserialise a context handle.
+ */
+
 #include "gssapiP_eap.h"
 
 #define UPDATE_REMAIN(n)    do {                \
@@ -247,8 +251,8 @@ gssEapImportContext(OM_uint32 *minor,
     remain -= 16;
 
     /* Validate state */
-    if (ctx->state < EAP_STATE_IDENTITY ||
-        ctx->state > EAP_STATE_ESTABLISHED)
+    if (ctx->state < GSSEAP_STATE_IDENTITY ||
+        ctx->state > GSSEAP_STATE_ESTABLISHED)
         return GSS_S_DEFECTIVE_TOKEN;
 
     /* Only acceptor can export partial context tokens */
@@ -285,7 +289,7 @@ gssEapImportContext(OM_uint32 *minor,
         *minor = GSSEAP_TOK_TRUNC;
         return GSS_S_DEFECTIVE_TOKEN;
     }
-    ctx->expiryTime = (time_t)load_uint64_be(&p[0]); /* XXX */
+    ctx->expiryTime = (time_t)load_uint64_be(&p[0]);
     ctx->sendSeq    = load_uint64_be(&p[8]);
     ctx->recvSeq    = load_uint64_be(&p[16]);
     p      += 24;
@@ -300,7 +304,7 @@ gssEapImportContext(OM_uint32 *minor,
      * acceptor contexts.
      */
     if (!CTX_IS_INITIATOR(ctx) && !CTX_IS_ESTABLISHED(ctx)) {
-        assert((ctx->flags & CTX_FLAG_KRB_REAUTH_GSS) == 0);
+        assert((ctx->flags & CTX_FLAG_KRB_REAUTH) == 0);
 
         major = gssEapImportPartialContext(minor, &p, &remain, ctx);
         if (GSS_ERROR(major))