projects
/
mech_eap.orig
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove debugging statement
[mech_eap.orig]
/
delete_sec_context.c
diff --git
a/delete_sec_context.c
b/delete_sec_context.c
index
663c7fc
..
7bd9cfb
100644
(file)
--- a/
delete_sec_context.c
+++ b/
delete_sec_context.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.
*/
+/*
+ * Release a context handle.
+ */
+
#include "gssapiP_eap.h"
OM_uint32
#include "gssapiP_eap.h"
OM_uint32
@@
-38,16
+42,19
@@
gss_delete_sec_context(OM_uint32 *minor,
gss_buffer_t output_token)
{
OM_uint32 major;
gss_buffer_t output_token)
{
OM_uint32 major;
+ gss_ctx_id_t ctx = *context_handle;
+
+ *minor = 0;
if (output_token != GSS_C_NO_BUFFER) {
output_token->length = 0;
output_token->value = NULL;
}
if (output_token != GSS_C_NO_BUFFER) {
output_token->length = 0;
output_token->value = NULL;
}
- if (*context_handle == GSS_C_NO_CONTEXT) {
- *minor = 0;
+ if (ctx == GSS_C_NO_CONTEXT)
return GSS_S_COMPLETE;
return GSS_S_COMPLETE;
- }
+
+ GSSEAP_MUTEX_LOCK(&ctx->mutex);
if (output_token != GSS_C_NO_BUFFER) {
gss_iov_buffer_desc iov[2];
if (output_token != GSS_C_NO_BUFFER) {
gss_iov_buffer_desc iov[2];
@@
-60,11
+67,15
@@
gss_delete_sec_context(OM_uint32 *minor,
iov[1].buffer.value = NULL;
iov[1].buffer.length = 0;
iov[1].buffer.value = NULL;
iov[1].buffer.length = 0;
- major = gssEapWrapOrGetMIC(minor,
*context_handle
, FALSE, FALSE,
+ major = gssEapWrapOrGetMIC(minor,
ctx
, FALSE, FALSE,
iov, 2, TOK_TYPE_DELETE_CONTEXT);
iov, 2, TOK_TYPE_DELETE_CONTEXT);
- if (GSS_ERROR(major))
+ if (GSS_ERROR(major)) {
+ GSSEAP_MUTEX_UNLOCK(&ctx->mutex);
return major;
return major;
+ }
}
}
+ GSSEAP_MUTEX_UNLOCK(&ctx->mutex);
+
return gssEapReleaseContext(minor, context_handle);
}
return gssEapReleaseContext(minor, context_handle);
}