From: Theodore Tso Date: Mon, 25 May 1998 01:45:17 +0000 (+0000) Subject: inq_cred.c (krb5_gss_inquire_cred): X-Git-Tag: krb5-1.1-beta1~716 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e080fc563d3d78355689de54ab56f89dc92bf5ed;p=krb5.git inq_cred.c (krb5_gss_inquire_cred): inq_context.c (krb5_gss_inquire_context): import_name.c (krb5_gss_import_name): export_name.c (krb5_gss_export_name): disp_name.c (krb5_gss_display_name): context_time.c (krb5_gss_context_time): acquire_cred.c (krb5_gss_acquire_cred): Clean up -Wall flames. indicate_mechs.c (krb5_gss_indicate_mechs): Return a dynamic OID set. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10577 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/krb5/ChangeLog b/src/lib/gssapi/krb5/ChangeLog index d78347bad..d736938f7 100644 --- a/src/lib/gssapi/krb5/ChangeLog +++ b/src/lib/gssapi/krb5/ChangeLog @@ -1,3 +1,16 @@ +1998-05-18 Theodore Ts'o + + * inq_cred.c (krb5_gss_inquire_cred): + * inq_context.c (krb5_gss_inquire_context): + * import_name.c (krb5_gss_import_name): + * export_name.c (krb5_gss_export_name): + * disp_name.c (krb5_gss_display_name): + * context_time.c (krb5_gss_context_time): + * acquire_cred.c (krb5_gss_acquire_cred): Clean up -Wall flames. + + * indicate_mechs.c (krb5_gss_indicate_mechs): Return a dynamic OID + set. + Fri Feb 27 18:41:08 1998 Theodore Y. Ts'o * export_name.c (krb5_gss_export_name): Fix bug in diff --git a/src/lib/gssapi/krb5/acquire_cred.c b/src/lib/gssapi/krb5/acquire_cred.c index 272ea426d..1ca1bf31a 100644 --- a/src/lib/gssapi/krb5/acquire_cred.c +++ b/src/lib/gssapi/krb5/acquire_cred.c @@ -56,7 +56,7 @@ acquire_accept_cred(context, minor_status, desired_name, output_princ, cred) /* open the default keytab */ - if (code = krb5_kt_default(context, &kt)) { + if ((code = krb5_kt_default(context, &kt))) { *minor_status = code; return(GSS_S_CRED_UNAVAIL); } @@ -65,8 +65,8 @@ acquire_accept_cred(context, minor_status, desired_name, output_princ, cred) requested, use the default sn2princ output */ if (desired_name == (gss_name_t) NULL) { - if (code = krb5_sname_to_principal(context, NULL, NULL, KRB5_NT_SRV_HST, - &princ)) { + if ((code = krb5_sname_to_principal(context, NULL, NULL, KRB5_NT_SRV_HST, + &princ))) { (void) krb5_kt_close(context, kt); *minor_status = code; return(GSS_S_FAILURE); @@ -76,7 +76,7 @@ acquire_accept_cred(context, minor_status, desired_name, output_princ, cred) princ = (krb5_principal) desired_name; } - if (code = krb5_kt_get_entry(context, kt, princ, 0, 0, &entry)) { + if ((code = krb5_kt_get_entry(context, kt, princ, 0, 0, &entry))) { (void) krb5_kt_close(context, kt); if (code == KRB5_KT_NOTFOUND) *minor_status = KG_KEYTAB_NOMATCH; @@ -128,7 +128,7 @@ acquire_init_cred(context, minor_status, desired_name, output_princ, cred) /* open the default credential cache */ - if (code = krb5_cc_default(context, &ccache)) { + if ((code = krb5_cc_default(context, &ccache))) { *minor_status = code; return(GSS_S_CRED_UNAVAIL); } @@ -136,14 +136,14 @@ acquire_init_cred(context, minor_status, desired_name, output_princ, cred) /* turn off OPENCLOSE mode while extensive frobbing is going on */ flags = 0; /* turns off OPENCLOSE mode */ - if (code = krb5_cc_set_flags(context, ccache, flags)) { + if ((code = krb5_cc_set_flags(context, ccache, flags))) { *minor_status = code; return(GSS_S_CRED_UNAVAIL); } /* get out the principal name and see if it matches */ - if (code = krb5_cc_get_principal(context, ccache, &princ)) { + if ((code = krb5_cc_get_principal(context, ccache, &princ))) { (void)krb5_cc_close(context, ccache); *minor_status = code; return(GSS_S_FAILURE); @@ -164,7 +164,7 @@ acquire_init_cred(context, minor_status, desired_name, output_princ, cred) /* iterate over the ccache, find the tgt */ - if (code = krb5_cc_start_seq_get(context, ccache, &cur)) { + if ((code = krb5_cc_start_seq_get(context, ccache, &cur))) { (void)krb5_cc_close(context, ccache); *minor_status = code; return(GSS_S_FAILURE); @@ -210,13 +210,13 @@ acquire_init_cred(context, minor_status, desired_name, output_princ, cred) return(GSS_S_FAILURE); } else { /* this means that we found an endtime to use. */ - if (code = krb5_cc_end_seq_get(context, ccache, &cur)) { + if ((code = krb5_cc_end_seq_get(context, ccache, &cur))) { (void)krb5_cc_close(context, ccache); *minor_status = code; return(GSS_S_FAILURE); } flags = KRB5_TC_OPENCLOSE; /* turns on OPENCLOSE mode */ - if (code = krb5_cc_set_flags(context, ccache, flags)) { + if ((code = krb5_cc_set_flags(context, ccache, flags))) { (void)krb5_cc_close(context, ccache); *minor_status = code; return(GSS_S_FAILURE); @@ -367,8 +367,8 @@ krb5_gss_acquire_cred(minor_status, desired_name, time_req, /* if the princ wasn't filled in already, fill it in now */ if (!cred->princ) - if (code = krb5_copy_principal(context, (krb5_principal) desired_name, - &(cred->princ))) { + if ((code = krb5_copy_principal(context, (krb5_principal) desired_name, + &(cred->princ)))) { if (cred->ccache) (void)krb5_cc_close(context, cred->ccache); if (cred->keytab) @@ -388,7 +388,7 @@ krb5_gss_acquire_cred(minor_status, desired_name, time_req, } else { krb5_timestamp now; - if (code = krb5_timeofday(context, &now)) { + if ((code = krb5_timeofday(context, &now))) { if (cred->ccache) (void)krb5_cc_close(context, cred->ccache); if (cred->keytab) diff --git a/src/lib/gssapi/krb5/context_time.c b/src/lib/gssapi/krb5/context_time.c index 76f1489b7..8b94ee587 100644 --- a/src/lib/gssapi/krb5/context_time.c +++ b/src/lib/gssapi/krb5/context_time.c @@ -54,7 +54,7 @@ krb5_gss_context_time(minor_status, context_handle, time_rec) return(GSS_S_NO_CONTEXT); } - if (code = krb5_timeofday(context, &now)) { + if ((code = krb5_timeofday(context, &now))) { *minor_status = code; return(GSS_S_FAILURE); } diff --git a/src/lib/gssapi/krb5/disp_name.c b/src/lib/gssapi/krb5/disp_name.c index 77f520035..b7e183048 100644 --- a/src/lib/gssapi/krb5/disp_name.c +++ b/src/lib/gssapi/krb5/disp_name.c @@ -45,7 +45,8 @@ krb5_gss_display_name(minor_status, input_name, output_name_buffer, return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME); } - if (code = krb5_unparse_name(context, (krb5_principal) input_name, &str)) { + if ((code = krb5_unparse_name(context, + (krb5_principal) input_name, &str))) { *minor_status = code; return(GSS_S_FAILURE); } diff --git a/src/lib/gssapi/krb5/export_name.c b/src/lib/gssapi/krb5/export_name.c index f3d25db15..23cb080e0 100644 --- a/src/lib/gssapi/krb5/export_name.c +++ b/src/lib/gssapi/krb5/export_name.c @@ -45,8 +45,8 @@ OM_uint32 krb5_gss_export_name(OM_uint32 *minor_status, return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME); } - if (code = krb5_unparse_name(context, (krb5_principal) input_name, - &str)) { + if ((code = krb5_unparse_name(context, (krb5_principal) input_name, + &str))) { *minor_status = code; return(GSS_S_FAILURE); } diff --git a/src/lib/gssapi/krb5/import_name.c b/src/lib/gssapi/krb5/import_name.c index 90206a701..74de61813 100644 --- a/src/lib/gssapi/krb5/import_name.c +++ b/src/lib/gssapi/krb5/import_name.c @@ -85,7 +85,7 @@ krb5_gss_import_name(minor_status, input_name_buffer, tmp[input_name_buffer->length] = 0; service = tmp; - if (host = strchr(tmp, '@')) { + if ((host = strchr(tmp, '@'))) { *host = '\0'; host++; } diff --git a/src/lib/gssapi/krb5/indicate_mechs.c b/src/lib/gssapi/krb5/indicate_mechs.c index bc53b4434..9c1ca59e6 100644 --- a/src/lib/gssapi/krb5/indicate_mechs.c +++ b/src/lib/gssapi/krb5/indicate_mechs.c @@ -32,6 +32,12 @@ krb5_gss_indicate_mechs(minor_status, mech_set) gss_OID_set *mech_set; { *minor_status = 0; - *mech_set = (gss_OID_set) gss_mech_set_krb5; + + if (! g_copy_OID_set(gss_mech_set_krb5, mech_set)) { + *mech_set = GSS_C_NO_OID_SET; + *minor_status = ENOMEM; + return(GSS_S_FAILURE); + } + return(GSS_S_COMPLETE); } diff --git a/src/lib/gssapi/krb5/inq_context.c b/src/lib/gssapi/krb5/inq_context.c index 5e5746344..5c156f86d 100644 --- a/src/lib/gssapi/krb5/inq_context.c +++ b/src/lib/gssapi/krb5/inq_context.c @@ -67,7 +67,7 @@ krb5_gss_inquire_context(minor_status, context_handle, initiator_name, init = NULL; accept = NULL; - if (code = krb5_timeofday(context, &now)) { + if ((code = krb5_timeofday(context, &now))) { *minor_status = code; return(GSS_S_FAILURE); } @@ -76,9 +76,9 @@ krb5_gss_inquire_context(minor_status, context_handle, initiator_name, lifetime = 0; if (initiator_name) { - if (code = krb5_copy_principal(context, - ctx->initiate?ctx->here:ctx->there, - &init)) { + if ((code = krb5_copy_principal(context, + ctx->initiate?ctx->here:ctx->there, + &init))) { *minor_status = code; return(GSS_S_FAILURE); } @@ -90,9 +90,9 @@ krb5_gss_inquire_context(minor_status, context_handle, initiator_name, } if (acceptor_name) { - if (code = krb5_copy_principal(context, - ctx->initiate?ctx->there:ctx->here, - &accept)) { + if ((code = krb5_copy_principal(context, + ctx->initiate?ctx->there:ctx->here, + &accept))) { if (init) krb5_free_principal(context, init); *minor_status = code; return(GSS_S_FAILURE); diff --git a/src/lib/gssapi/krb5/inq_cred.c b/src/lib/gssapi/krb5/inq_cred.c index b2edc2571..ee5d436c1 100644 --- a/src/lib/gssapi/krb5/inq_cred.c +++ b/src/lib/gssapi/krb5/inq_cred.c @@ -65,7 +65,7 @@ krb5_gss_inquire_cred(minor_status, cred_handle, name, lifetime_ret, cred = (krb5_gss_cred_id_t) cred_handle; - if (code = krb5_timeofday(context, &now)) { + if ((code = krb5_timeofday(context, &now))) { *minor_status = code; return(GSS_S_FAILURE); } @@ -78,7 +78,7 @@ krb5_gss_inquire_cred(minor_status, cred_handle, name, lifetime_ret, lifetime = GSS_C_INDEFINITE; if (name) { - if (code = krb5_copy_principal(context, cred->princ, &ret_name)) { + if ((code = krb5_copy_principal(context, cred->princ, &ret_name))) { *minor_status = code; return(GSS_S_FAILURE); } diff --git a/src/lib/gssapi/krb5/k5seal.c b/src/lib/gssapi/krb5/k5seal.c index 254d51680..1182b5f31 100644 --- a/src/lib/gssapi/krb5/k5seal.c +++ b/src/lib/gssapi/krb5/k5seal.c @@ -114,7 +114,7 @@ make_seal_token(context, enc_ed, seq_ed, seqnum, direction, text, token, return(ENOMEM); } - if (code = kg_make_confounder(enc_ed, plain)) { + if ((code = kg_make_confounder(enc_ed, plain))) { xfree(plain); xfree(md5cksum.contents); xfree(t); @@ -133,8 +133,9 @@ make_seal_token(context, enc_ed, seq_ed, seqnum, direction, text, token, } if (encrypt) { - if (code = kg_encrypt(context, enc_ed, NULL, (krb5_pointer) plain, - (krb5_pointer) (ptr+cksum_size+14), tmsglen)) { + if ((code = kg_encrypt(context, enc_ed, NULL, (krb5_pointer) plain, + (krb5_pointer) (ptr+cksum_size+14), + tmsglen))) { if (plain) xfree(plain); xfree(md5cksum.contents); @@ -234,10 +235,10 @@ make_seal_token(context, enc_ed, seq_ed, seqnum, direction, text, token, xfree(cksum.contents); #else - if (code = kg_encrypt(context, seq_ed, - (g_OID_equal(oid, gss_mech_krb5_old) ? - seq_ed->key->contents : NULL), - md5cksum.contents, md5cksum.contents, 16)) { + if ((code = kg_encrypt(context, seq_ed, + (g_OID_equal(oid, gss_mech_krb5_old) ? + seq_ed->key->contents : NULL), + md5cksum.contents, md5cksum.contents, 16))) { xfree(md5cksum.contents); xfree(t); return code; @@ -256,8 +257,8 @@ make_seal_token(context, enc_ed, seq_ed, seqnum, direction, text, token, /* create the seq_num */ - if (code = kg_make_seq_num(context, seq_ed, direction?0:0xff, *seqnum, - ptr+14, ptr+6)) { + if ((code = kg_make_seq_num(context, seq_ed, direction?0:0xff, *seqnum, + ptr+14, ptr+6))) { xfree(t); return(code); }