(_gss_DES3_get_mic_compat): don't unlock mutex here. Bug reported by

Stefan Metzmacher <metze@samba.org>


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14605 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-03-01 09:20:56 +00:00
parent 81dcda73d0
commit 110f1ca86e
2 changed files with 14 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003 - 2004 Kungliga Tekniska H<>gskolan * Copyright (c) 2003 - 2005 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -77,6 +77,10 @@ check_compat(OM_uint32 *minor_status, gss_name_t name,
return 0; return 0;
} }
/*
* ctx->ctx_id_mutex is assumed to be locked
*/
OM_uint32 OM_uint32
_gss_DES3_get_mic_compat(OM_uint32 *minor_status, gss_ctx_id_t ctx) _gss_DES3_get_mic_compat(OM_uint32 *minor_status, gss_ctx_id_t ctx)
{ {
@@ -86,16 +90,12 @@ _gss_DES3_get_mic_compat(OM_uint32 *minor_status, gss_ctx_id_t ctx)
if ((ctx->more_flags & COMPAT_OLD_DES3_SELECTED) == 0) { if ((ctx->more_flags & COMPAT_OLD_DES3_SELECTED) == 0) {
ret = check_compat(minor_status, ctx->target, ret = check_compat(minor_status, ctx->target,
"broken_des3_mic", &use_compat, TRUE); "broken_des3_mic", &use_compat, TRUE);
if (ret) { if (ret)
HEIMDAL_MUTEX_unlock(&ctx->ctx_id_mutex);
return ret; return ret;
}
ret = check_compat(minor_status, ctx->target, ret = check_compat(minor_status, ctx->target,
"correct_des3_mic", &use_compat, FALSE); "correct_des3_mic", &use_compat, FALSE);
if (ret) { if (ret)
HEIMDAL_MUTEX_unlock(&ctx->ctx_id_mutex);
return ret; return ret;
}
if (use_compat) if (use_compat)
ctx->more_flags |= COMPAT_OLD_DES3; ctx->more_flags |= COMPAT_OLD_DES3;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003 - 2004 Kungliga Tekniska H<>gskolan * Copyright (c) 2003 - 2005 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -77,6 +77,10 @@ check_compat(OM_uint32 *minor_status, gss_name_t name,
return 0; return 0;
} }
/*
* ctx->ctx_id_mutex is assumed to be locked
*/
OM_uint32 OM_uint32
_gss_DES3_get_mic_compat(OM_uint32 *minor_status, gss_ctx_id_t ctx) _gss_DES3_get_mic_compat(OM_uint32 *minor_status, gss_ctx_id_t ctx)
{ {
@@ -86,16 +90,12 @@ _gss_DES3_get_mic_compat(OM_uint32 *minor_status, gss_ctx_id_t ctx)
if ((ctx->more_flags & COMPAT_OLD_DES3_SELECTED) == 0) { if ((ctx->more_flags & COMPAT_OLD_DES3_SELECTED) == 0) {
ret = check_compat(minor_status, ctx->target, ret = check_compat(minor_status, ctx->target,
"broken_des3_mic", &use_compat, TRUE); "broken_des3_mic", &use_compat, TRUE);
if (ret) { if (ret)
HEIMDAL_MUTEX_unlock(&ctx->ctx_id_mutex);
return ret; return ret;
}
ret = check_compat(minor_status, ctx->target, ret = check_compat(minor_status, ctx->target,
"correct_des3_mic", &use_compat, FALSE); "correct_des3_mic", &use_compat, FALSE);
if (ret) { if (ret)
HEIMDAL_MUTEX_unlock(&ctx->ctx_id_mutex);
return ret; return ret;
}
if (use_compat) if (use_compat)
ctx->more_flags |= COMPAT_OLD_DES3; ctx->more_flags |= COMPAT_OLD_DES3;