projects
/
mech_eap.orig
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
comment out dumping code
[mech_eap.orig]
/
context_time.c
diff --git
a/context_time.c
b/context_time.c
index
b72dcf0
..
1486065
100644
(file)
--- a/
context_time.c
+++ b/
context_time.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 201
0
, JANET(UK)
+ * Copyright (c) 201
1
, JANET(UK)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@
-30,6
+30,10
@@
* SUCH DAMAGE.
*/
* SUCH DAMAGE.
*/
+/*
+ * Determine remaining lifetime of a context handle.
+ */
+
#include "gssapiP_eap.h"
OM_uint32
#include "gssapiP_eap.h"
OM_uint32
@@
-39,19
+43,24
@@
gss_context_time(OM_uint32 *minor,
{
OM_uint32 major;
{
OM_uint32 major;
- *minor = 0;
+ if (ctx == GSS_C_NO_CONTEXT) {
+ *minor = EINVAL;
+ return GSS_S_CALL_INACCESSIBLE_READ | GSS_S_NO_CONTEXT;
+ }
- if (ctx == GSS_C_NO_CONTEXT)
- return GSS_S_NO_CONTEXT;
+ *minor = 0;
GSSEAP_MUTEX_LOCK(&ctx->mutex);
if (!CTX_IS_ESTABLISHED(ctx)) {
GSSEAP_MUTEX_LOCK(&ctx->mutex);
if (!CTX_IS_ESTABLISHED(ctx)) {
+ *minor = GSSEAP_CONTEXT_INCOMPLETE;
major = GSS_S_NO_CONTEXT;
goto cleanup;
}
major = gssEapContextTime(minor, ctx, time_rec);
major = GSS_S_NO_CONTEXT;
goto cleanup;
}
major = gssEapContextTime(minor, ctx, time_rec);
+ if (GSS_ERROR(major))
+ goto cleanup;
cleanup:
GSSEAP_MUTEX_UNLOCK(&ctx->mutex);
cleanup:
GSSEAP_MUTEX_UNLOCK(&ctx->mutex);