projects
/
mech_eap.orig
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d5a9b52
)
acquire lock in gss_wrap_size_limit
author
Luke Howard
<lukeh@padl.com>
Sat, 2 Oct 2010 20:15:58 +0000
(22:15 +0200)
committer
Luke Howard
<lukeh@padl.com>
Sat, 2 Oct 2010 20:15:58 +0000
(22:15 +0200)
wrap_size_limit.c
patch
|
blob
|
history
diff --git
a/wrap_size_limit.c
b/wrap_size_limit.c
index
0e640ae
..
615010f
100644
(file)
--- a/
wrap_size_limit.c
+++ b/
wrap_size_limit.c
@@
-43,6
+43,18
@@
gss_wrap_size_limit(OM_uint32 *minor,
gss_iov_buffer_desc iov[4];
OM_uint32 major, overhead;
gss_iov_buffer_desc iov[4];
OM_uint32 major, overhead;
+ *minor = 0;
+
+ if (ctx == GSS_C_NO_CONTEXT)
+ return GSS_S_NO_CONTEXT;
+
+ GSSEAP_MUTEX_LOCK(&ctx->mutex);
+
+ if (!CTX_IS_ESTABLISHED(ctx)) {
+ major = GSS_S_NO_CONTEXT;
+ goto cleanup;
+ }
+
iov[0].type = GSS_IOV_BUFFER_TYPE_HEADER;
iov[0].buffer.value = NULL;
iov[0].buffer.length = 0;
iov[0].type = GSS_IOV_BUFFER_TYPE_HEADER;
iov[0].buffer.value = NULL;
iov[0].buffer.length = 0;
@@
-61,9
+73,8
@@
gss_wrap_size_limit(OM_uint32 *minor,
major = gssEapWrapIovLength(minor, ctx, conf_req_flag, qop_req,
NULL, iov, 4);
major = gssEapWrapIovLength(minor, ctx, conf_req_flag, qop_req,
NULL, iov, 4);
- if (GSS_ERROR(major)) {
- return major;
- }
+ if (GSS_ERROR(major))
+ goto cleanup;
overhead = iov[0].buffer.length + iov[3].buffer.length;
overhead = iov[0].buffer.length + iov[3].buffer.length;
@@
-72,5
+83,8
@@
gss_wrap_size_limit(OM_uint32 *minor,
else
*max_input_size = 0;
else
*max_input_size = 0;
- return GSS_S_COMPLETE;
+cleanup:
+ GSSEAP_MUTEX_UNLOCK(&ctx->mutex);
+
+ return major;
}
}