From: Keith Vetter Date: Wed, 8 Mar 1995 05:09:18 +0000 (+0000) Subject: Made explicit the signed to unsigned conversions in the gssapi/krb5 X-Git-Tag: krb5-1.0-beta5~584 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2110f5af9488edc80c1a189d4eb9b9b26fcb09de;p=krb5.git Made explicit the signed to unsigned conversions in the gssapi/krb5 directory. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5086 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/krb5/ChangeLog b/src/lib/gssapi/krb5/ChangeLog index 5bffc52fb..291cdd718 100644 --- a/src/lib/gssapi/krb5/ChangeLog +++ b/src/lib/gssapi/krb5/ChangeLog @@ -1,3 +1,13 @@ +Tue Mar 7 20:48:03 1995 Keith Vetter (keithv@fusion.com) + + * accept_s.c, acqire_s.c, compare_.c, context_.c, delete_s.c, + disp_nam.c, disp_sta.c, get_tkt_.c, init_sec.c, inq_cont.c, + inq_cred.c, k5seal.c, k5unseal.c, process_.c, rel_cred.c, + rel_name.c, util_cks.c, util_cry.c: added casts on signed -> + unsigned assignments. + * util_seq.c: added casts on bit extraction code. + * gssapip_.h: pulls in los-proto.h for prototypes. + Tue Feb 28 00:27:44 1995 John Gilmore (gnu at toad.com) * gssapi_krb5.h, gssapiP_krb5.h: Avoid includes. diff --git a/src/lib/gssapi/krb5/accept_sec_context.c b/src/lib/gssapi/krb5/accept_sec_context.c index e39445899..231a3628f 100644 --- a/src/lib/gssapi/krb5/accept_sec_context.c +++ b/src/lib/gssapi/krb5/accept_sec_context.c @@ -173,7 +173,7 @@ krb5_gss_accept_sec_context(context, minor_status, context_handle, return(GSS_S_NO_CRED); } else { if (! kg_validate_cred_id(verifier_cred_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_DEFECTIVE_CREDENTIAL); } } @@ -439,7 +439,7 @@ krb5_gss_accept_sec_context(context, minor_status, context_handle, xfree(token.value); (void)krb5_gss_delete_sec_context(context, minor_status, (gss_ctx_id_t *) &ctx, NULL); - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_FAILURE); } @@ -454,7 +454,7 @@ krb5_gss_accept_sec_context(context, minor_status, context_handle, xfree(token.value); (void)krb5_gss_delete_sec_context(context, minor_status, (gss_ctx_id_t *) &ctx, NULL); - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_FAILURE); } diff --git a/src/lib/gssapi/krb5/acquire_cred.c b/src/lib/gssapi/krb5/acquire_cred.c index 19025b51b..419643b90 100644 --- a/src/lib/gssapi/krb5/acquire_cred.c +++ b/src/lib/gssapi/krb5/acquire_cred.c @@ -21,6 +21,11 @@ */ #include "gssapiP_krb5.h" +#ifdef USE_STRING_H +#include +#else +#include +#endif /* get credentials corresponding to a key in the krb5 keytab. If the default name is requested, return the name in output_princ. @@ -265,7 +270,7 @@ krb5_gss_acquire_cred(context, minor_status, desired_name, time_req, /*SUPPRESS 29*/ if ((desired_name != GSS_C_NO_NAME) && (! kg_validate_name(desired_name))) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME); } @@ -300,7 +305,7 @@ krb5_gss_acquire_cred(context, minor_status, desired_name, time_req, (cred_usage != GSS_C_ACCEPT) && (cred_usage != GSS_C_BOTH)) { xfree(cred); - *minor_status = G_BAD_USAGE; + *minor_status = (OM_uint32) G_BAD_USAGE; return(GSS_S_FAILURE); } @@ -407,7 +412,7 @@ krb5_gss_acquire_cred(context, minor_status, desired_name, time_req, if (cred->princ) krb5_free_principal(context, cred->princ); xfree(cred); - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_FAILURE); } diff --git a/src/lib/gssapi/krb5/compare_name.c b/src/lib/gssapi/krb5/compare_name.c index c81c6c71d..e73797a62 100644 --- a/src/lib/gssapi/krb5/compare_name.c +++ b/src/lib/gssapi/krb5/compare_name.c @@ -31,12 +31,12 @@ krb5_gss_compare_name(context, minor_status, name1, name2, name_equal) int *name_equal; { if (! kg_validate_name(name1)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME); } if (! kg_validate_name(name2)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME); } diff --git a/src/lib/gssapi/krb5/context_time.c b/src/lib/gssapi/krb5/context_time.c index aa76b4f82..05276c305 100644 --- a/src/lib/gssapi/krb5/context_time.c +++ b/src/lib/gssapi/krb5/context_time.c @@ -36,7 +36,7 @@ krb5_gss_context_time(context, minor_status, context_handle, time_rec) /* validate the context handle */ if (! kg_validate_ctx_id(context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } diff --git a/src/lib/gssapi/krb5/delete_sec_context.c b/src/lib/gssapi/krb5/delete_sec_context.c index cf3ce4193..e7ccdfa33 100644 --- a/src/lib/gssapi/krb5/delete_sec_context.c +++ b/src/lib/gssapi/krb5/delete_sec_context.c @@ -45,7 +45,7 @@ krb5_gss_delete_sec_context(context, minor_status, context_handle, output_token) /*SUPPRESS 29*/ /* validate the context handle */ if (! kg_validate_ctx_id(*context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } diff --git a/src/lib/gssapi/krb5/disp_name.c b/src/lib/gssapi/krb5/disp_name.c index e6047c96e..f59d7aef8 100644 --- a/src/lib/gssapi/krb5/disp_name.c +++ b/src/lib/gssapi/krb5/disp_name.c @@ -38,7 +38,7 @@ krb5_gss_display_name(context, minor_status, input_name, output_name_buffer, output_name_buffer->value = NULL; if (! kg_validate_name(input_name)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME); } @@ -50,7 +50,7 @@ krb5_gss_display_name(context, minor_status, input_name, output_name_buffer, if (! g_make_string_buffer(str, output_name_buffer)) { xfree(str); - *minor_status = G_BUFFER_ALLOC; + *minor_status = (OM_uint32) G_BUFFER_ALLOC; return(GSS_S_FAILURE); } diff --git a/src/lib/gssapi/krb5/disp_status.c b/src/lib/gssapi/krb5/disp_status.c index 38734f69f..e1df99803 100644 --- a/src/lib/gssapi/krb5/disp_status.c +++ b/src/lib/gssapi/krb5/disp_status.c @@ -62,7 +62,7 @@ krb5_gss_display_status(context, minor_status, status_value, status_type, } if (*message_context) { - *minor_status = G_BAD_MSG_CTX; + *minor_status = (OM_uint32) G_BAD_MSG_CTX; return(GSS_S_FAILURE); } diff --git a/src/lib/gssapi/krb5/get_tkt_flags.c b/src/lib/gssapi/krb5/get_tkt_flags.c index 91360a8af..1708e564e 100644 --- a/src/lib/gssapi/krb5/get_tkt_flags.c +++ b/src/lib/gssapi/krb5/get_tkt_flags.c @@ -32,7 +32,7 @@ gss_krb5_get_tkt_flags(minor_status, context_handle, ticket_flags) /* validate the context handle */ if (! kg_validate_ctx_id(context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } diff --git a/src/lib/gssapi/krb5/gssapiP_krb5.h b/src/lib/gssapi/krb5/gssapiP_krb5.h index 453c86b5e..f1576ec75 100644 --- a/src/lib/gssapi/krb5/gssapiP_krb5.h +++ b/src/lib/gssapi/krb5/gssapiP_krb5.h @@ -24,6 +24,7 @@ #define _GSSAPIP_KRB5_H_ #include "krb5.h" +#include "los-proto.h" #include /* work around sunos braindamage */ diff --git a/src/lib/gssapi/krb5/init_sec_context.c b/src/lib/gssapi/krb5/init_sec_context.c index e65e6d0d0..21ca4977d 100644 --- a/src/lib/gssapi/krb5/init_sec_context.c +++ b/src/lib/gssapi/krb5/init_sec_context.c @@ -42,7 +42,6 @@ make_ap_req(context, cred, server, endtime, chan_bindings, do_mutual, krb5_creds in_creds, * out_creds; krb5_authenticator authent; krb5_data ap_req; - long tmp; unsigned char *ptr; unsigned char ckbuf[24]; /* see the token formats doc */ unsigned char *t; @@ -193,7 +192,7 @@ krb5_gss_init_sec_context(context, minor_status, claimant_cred_handle, } } else { if (! kg_validate_cred_id(claimant_cred_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_DEFECTIVE_CREDENTIAL); } } @@ -203,7 +202,7 @@ krb5_gss_init_sec_context(context, minor_status, claimant_cred_handle, /* verify that the target_name is valid and usable */ if (! kg_validate_name(target_name)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME); } @@ -307,7 +306,7 @@ krb5_gss_init_sec_context(context, minor_status, claimant_cred_handle, krb5_free_principal(context, ctx->there); xfree(ctx); - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_FAILURE); } @@ -354,7 +353,7 @@ krb5_gss_init_sec_context(context, minor_status, claimant_cred_handle, /* validate the context handle */ /*SUPPRESS 29*/ if (! kg_validate_ctx_id(*context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } diff --git a/src/lib/gssapi/krb5/inq_context.c b/src/lib/gssapi/krb5/inq_context.c index b7a8507cc..927483396 100644 --- a/src/lib/gssapi/krb5/inq_context.c +++ b/src/lib/gssapi/krb5/inq_context.c @@ -49,7 +49,7 @@ krb5_gss_inquire_context(context, minor_status, context_handle, initiator_name, /* validate the context handle */ if (! kg_validate_ctx_id(context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } @@ -80,7 +80,7 @@ krb5_gss_inquire_context(context, minor_status, context_handle, initiator_name, } if (! kg_save_name((gss_name_t) init)) { krb5_free_principal(context, init); - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_FAILURE); } } @@ -99,7 +99,7 @@ krb5_gss_inquire_context(context, minor_status, context_handle, initiator_name, kg_delete_name((gss_name_t) accept); krb5_free_principal(context, init); } - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_FAILURE); } } diff --git a/src/lib/gssapi/krb5/inq_cred.c b/src/lib/gssapi/krb5/inq_cred.c index 7aee2632c..fb5346281 100644 --- a/src/lib/gssapi/krb5/inq_cred.c +++ b/src/lib/gssapi/krb5/inq_cred.c @@ -54,7 +54,7 @@ krb5_gss_inquire_cred(context, minor_status, cred_handle, name, lifetime_ret, } } else { if (! kg_validate_cred_id(cred_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_NO_CRED); } } @@ -87,7 +87,7 @@ krb5_gss_inquire_cred(context, minor_status, cred_handle, name, lifetime_ret, if (! kg_save_name((gss_name_t) ret_name)) { (void)gss_release_oid_set(minor_status, &mechs); krb5_free_principal(context, ret_name); - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_FAILURE); } *name = (gss_name_t) ret_name; diff --git a/src/lib/gssapi/krb5/k5seal.c b/src/lib/gssapi/krb5/k5seal.c index d475b010a..0958a8736 100644 --- a/src/lib/gssapi/krb5/k5seal.c +++ b/src/lib/gssapi/krb5/k5seal.c @@ -200,13 +200,13 @@ kg_seal(minor_status, context_handle, conf_req_flag, qop_req, /* only default qop is allowed */ if (qop_req != GSS_C_QOP_DEFAULT) { - *minor_status = G_UNKNOWN_QOP; + *minor_status = (OM_uint32) G_UNKNOWN_QOP; return(GSS_S_FAILURE); } /* validate the context handle */ if (! kg_validate_ctx_id(context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } diff --git a/src/lib/gssapi/krb5/k5unseal.c b/src/lib/gssapi/krb5/k5unseal.c index ce0bde524..1e9e2580a 100644 --- a/src/lib/gssapi/krb5/k5unseal.c +++ b/src/lib/gssapi/krb5/k5unseal.c @@ -61,7 +61,7 @@ kg_unseal(minor_status, context_handle, input_token_buffer, message_buffer, /* validate the context handle */ if (! kg_validate_ctx_id(context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } diff --git a/src/lib/gssapi/krb5/krb5_gss_glue.c b/src/lib/gssapi/krb5/krb5_gss_glue.c index a449b79d8..584893143 100644 --- a/src/lib/gssapi/krb5/krb5_gss_glue.c +++ b/src/lib/gssapi/krb5/krb5_gss_glue.c @@ -42,7 +42,7 @@ gss_accept_sec_context(minor_status, context_handle, verifier_cred_handle, /* validate the context handle */ if (! kg_validate_ctx_id(context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } @@ -113,7 +113,7 @@ gss_context_time(minor_status, context_handle, time_rec) /* validate the context handle */ if (! kg_validate_ctx_id(context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } @@ -133,7 +133,7 @@ gss_delete_sec_context(minor_status, context_handle, output_token) /* validate the context handle */ if (! kg_validate_ctx_id(context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } @@ -247,7 +247,7 @@ gss_inquire_context(minor_status, context_handle, initiator_name, acceptor_name, /* validate the context handle */ if (! kg_validate_ctx_id(context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } @@ -285,7 +285,7 @@ gss_process_context_token(minor_status, context_handle, token_buffer) /* validate the context handle */ if (! kg_validate_ctx_id(context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } @@ -349,7 +349,7 @@ gss_seal(minor_status, context_handle, conf_req_flag, qop_req, /* validate the context handle */ if (! kg_validate_ctx_id(context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } @@ -372,7 +372,7 @@ gss_sign(minor_status, context_handle, qop_req, message_buffer, message_token) /* validate the context handle */ if (! kg_validate_ctx_id(context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } @@ -396,7 +396,7 @@ gss_unseal(minor_status, context_handle, input_message_buffer, /* validate the context handle */ if (! kg_validate_ctx_id(context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } @@ -420,7 +420,7 @@ gss_verify(minor_status, context_handle, message_buffer, /* validate the context handle */ if (! kg_validate_ctx_id(context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } diff --git a/src/lib/gssapi/krb5/process_context_token.c b/src/lib/gssapi/krb5/process_context_token.c index 3a6d404f0..1bea1a5f7 100644 --- a/src/lib/gssapi/krb5/process_context_token.c +++ b/src/lib/gssapi/krb5/process_context_token.c @@ -35,7 +35,7 @@ krb5_gss_process_context_token(context, minor_status, context_handle, /* validate the context handle */ if (! kg_validate_ctx_id(context_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_NO_CONTEXT); } diff --git a/src/lib/gssapi/krb5/rel_cred.c b/src/lib/gssapi/krb5/rel_cred.c index 28f1ff7b4..e976d0a22 100644 --- a/src/lib/gssapi/krb5/rel_cred.c +++ b/src/lib/gssapi/krb5/rel_cred.c @@ -35,7 +35,7 @@ krb5_gss_release_cred(context, minor_status, cred_handle) return(kg_release_defcred(minor_status)); if (! kg_delete_cred_id(*cred_handle)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_NO_CRED); } diff --git a/src/lib/gssapi/krb5/rel_name.c b/src/lib/gssapi/krb5/rel_name.c index fd0a88ebc..872746304 100644 --- a/src/lib/gssapi/krb5/rel_name.c +++ b/src/lib/gssapi/krb5/rel_name.c @@ -29,7 +29,7 @@ krb5_gss_release_name(context, minor_status, input_name) gss_name_t *input_name; { if (! kg_validate_name(*input_name)) { - *minor_status = G_VALIDATE_FAILED; + *minor_status = (OM_uint32) G_VALIDATE_FAILED; return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME); } diff --git a/src/lib/gssapi/krb5/util_cksum.c b/src/lib/gssapi/krb5/util_cksum.c index c17d2f5bb..d5c12aab2 100644 --- a/src/lib/gssapi/krb5/util_cksum.c +++ b/src/lib/gssapi/krb5/util_cksum.c @@ -31,7 +31,6 @@ kg_checksum_channel_bindings(cb, cksum, bigend) { int len; char *buf, *ptr; - long tmp; krb5_error_code code; if (!kg_context && (code=kg_get_context())) @@ -53,7 +52,7 @@ kg_checksum_channel_bindings(cb, cksum, bigend) /* create the buffer to checksum into */ - len = (sizeof(tmp)*5+ + len = (sizeof(long)*5+ cb->initiator_address.length+ cb->acceptor_address.length+ cb->application_data.length); diff --git a/src/lib/gssapi/krb5/util_crypt.c b/src/lib/gssapi/krb5/util_crypt.c index fcb4306ad..a53b7c2ce 100644 --- a/src/lib/gssapi/krb5/util_crypt.c +++ b/src/lib/gssapi/krb5/util_crypt.c @@ -39,8 +39,6 @@ kg_make_confounder(ed, buf) krb5_gss_enc_desc *ed; unsigned char *buf; { - krb5_error_code code; - return(krb5_random_confounder( ed->eblock.crypto_entry->block_length, buf)); } diff --git a/src/lib/gssapi/krb5/util_seqnum.c b/src/lib/gssapi/krb5/util_seqnum.c index a6d6ed597..7a9d31b5a 100644 --- a/src/lib/gssapi/krb5/util_seqnum.c +++ b/src/lib/gssapi/krb5/util_seqnum.c @@ -32,10 +32,10 @@ kg_make_seq_num(ed, direction, seqnum, cksum, buf) { unsigned char plain[8]; - plain[0] = seqnum&0xff; - plain[1] = (seqnum>>8)&0xff; - plain[2] = (seqnum>>16)&0xff; - plain[3] = (seqnum>>24)&0xff; + plain[0] = (unsigned char) (seqnum&0xff); + plain[1] = (unsigned char) ((seqnum>>8)&0xff); + plain[2] = (unsigned char) ((seqnum>>16)&0xff); + plain[3] = (unsigned char) ((seqnum>>24)&0xff); plain[4] = direction; plain[5] = direction;