X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=process_context_token.c;h=5bad3c0d77f63e5a4438d25ff812b79686de269b;hb=refs%2Fheads%2Fmeeting%2Fmoonshot2;hp=32e657c0b2d7ddc72cd38ac7d2b83e8c22394545;hpb=d5a9b52e3911edd09988005462028ed7dbdf5899;p=mech_eap.orig diff --git a/process_context_token.c b/process_context_token.c index 32e657c..5bad3c0 100644 --- a/process_context_token.c +++ b/process_context_token.c @@ -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 @@ -42,13 +42,16 @@ gss_process_context_token(OM_uint32 *minor, *minor = 0; - if (ctx == NULL) - return GSS_S_NO_CONTEXT; + if (ctx == NULL) { + *minor = EINVAL; + return GSS_S_CALL_INACCESSIBLE_READ | GSS_S_NO_CONTEXT; + } GSSEAP_MUTEX_LOCK(&ctx->mutex); if (!CTX_IS_ESTABLISHED(ctx)) { GSSEAP_MUTEX_UNLOCK(&ctx->mutex); + *minor = GSSEAP_CONTEXT_INCOMPLETE; return GSS_S_NO_CONTEXT; }