From 37cbaddce230cea7893771fb3ec9f5bab1a79335 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Mon, 1 Jul 2002 20:45:39 +0000 Subject: [PATCH] fix some compiler warnings git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14591 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/krb5/ChangeLog | 9 +++++++++ src/lib/gssapi/krb5/accept_sec_context.c | 18 +++++++++++------- src/lib/gssapi/krb5/k5unseal.c | 5 +---- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/lib/gssapi/krb5/ChangeLog b/src/lib/gssapi/krb5/ChangeLog index 96e3ad6cc..a7982c634 100644 --- a/src/lib/gssapi/krb5/ChangeLog +++ b/src/lib/gssapi/krb5/ChangeLog @@ -1,3 +1,12 @@ +2002-07-01 Ken Raeburn + + * accept_sec_context.c (rd_and_store_for_creds): Extra parens + around assignments to quiet gcc. + (krb5_gss_accept_sec_context): Fix some type mismatches between + OM_uint32 and krb5_error_code. + * k5unseal.c (kg_unseal_v1): Move a variable declaration and + assignment to fix gcc "possibly uninitialized" warning. + 2002-03-03 Sam Hartman * accept_sec_context.c (rd_and_store_for_creds): Patch from Steven diff --git a/src/lib/gssapi/krb5/accept_sec_context.c b/src/lib/gssapi/krb5/accept_sec_context.c index 08f90e8e1..d65c05379 100644 --- a/src/lib/gssapi/krb5/accept_sec_context.c +++ b/src/lib/gssapi/krb5/accept_sec_context.c @@ -93,7 +93,7 @@ rd_and_store_for_creds(context, auth_context, inbuf, out_cred) krb5_auth_context new_auth_ctx = NULL; krb5_int32 flags_org; - if (retval = krb5_auth_con_getflags(context, auth_context, &flags_org)) + if ((retval = krb5_auth_con_getflags(context, auth_context, &flags_org))) return retval; krb5_auth_con_setflags(context, auth_context, KRB5_AUTH_CONTEXT_DO_SEQUENCE); @@ -120,10 +120,10 @@ rd_and_store_for_creds(context, auth_context, inbuf, out_cred) * containing the KRB_CRED message does get encrypted.) */ if (krb5_rd_cred(context, auth_context, inbuf, &creds, NULL)) { - if (retval = krb5_auth_con_init(context, &new_auth_ctx)) + if ((retval = krb5_auth_con_init(context, &new_auth_ctx))) goto cleanup; krb5_auth_con_setflags(context, new_auth_ctx, 0); - if (retval = krb5_rd_cred(context, new_auth_ctx, inbuf, &creds, NULL)) + if ((retval = krb5_rd_cred(context, new_auth_ctx, inbuf, &creds, NULL))) goto cleanup; } @@ -277,19 +277,23 @@ krb5_gss_accept_sec_context(minor_status, context_handle, /* handle default cred handle */ if (verifier_cred_handle == GSS_C_NO_CREDENTIAL) { - major_status = krb5_gss_acquire_cred(&code, GSS_C_NO_NAME, + major_status = krb5_gss_acquire_cred(minor_status, GSS_C_NO_NAME, GSS_C_INDEFINITE, GSS_C_NO_OID_SET, GSS_C_ACCEPT, &cred_handle, NULL, NULL); - if (major_status != GSS_S_COMPLETE) + if (major_status != GSS_S_COMPLETE) { + code = *minor_status; goto fail; + } } else { cred_handle = verifier_cred_handle; } - major_status = krb5_gss_validate_cred(&code, verifier_cred_handle); - if (GSS_ERROR(major_status)) + major_status = krb5_gss_validate_cred(minor_status, verifier_cred_handle); + if (GSS_ERROR(major_status)) { + code = *minor_status; goto fail; + } cred = (krb5_gss_cred_id_t) cred_handle; diff --git a/src/lib/gssapi/krb5/k5unseal.c b/src/lib/gssapi/krb5/k5unseal.c index ebc8a760f..405215379 100644 --- a/src/lib/gssapi/krb5/k5unseal.c +++ b/src/lib/gssapi/krb5/k5unseal.c @@ -70,7 +70,6 @@ kg_unseal_v1(context, minor_status, ctx, ptr, bodysize, message_buffer, int toktype; { krb5_error_code code; - int tmsglen; int conflen = 0; int signalg; int sealalg; @@ -154,9 +153,6 @@ kg_unseal_v1(context, minor_status, ctx, ptr, bodysize, message_buffer, return GSS_S_DEFECTIVE_TOKEN; } - if (toktype == KG_TOK_SEAL_MSG) - tmsglen = bodysize-(14+cksum_len); - /* get the token parameters */ if ((code = kg_get_seq_num(context, ctx->seq, ptr+14, ptr+6, &direction, @@ -168,6 +164,7 @@ kg_unseal_v1(context, minor_status, ctx, ptr, bodysize, message_buffer, /* decode the message, if SEAL */ if (toktype == KG_TOK_SEAL_MSG) { + int tmsglen = bodysize-(14+cksum_len); if (sealalg != 0xffff) { if ((plain = (unsigned char *) xmalloc(tmsglen)) == NULL) { *minor_status = ENOMEM; -- 2.26.2