From e2a5f90e6224a4ab7ebe993362d8d7595477908d Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Fri, 15 Nov 2002 16:12:20 +0000 Subject: [PATCH] * accept_sec_context.c (krb5_gss_accept_sec_context): Use unsigned lengths for arguments to g_token_size and g_make_token_header. * export_name.c (krb5_gss_export_name): Change local length variable to unsigned. * k5unseal.c (kg_unseal_v1): Seqnum variable changed from krb5_int32 to krb5_ui_4. * k5seal.c (make_seal_token_v1): Change seqnum argument to krb5_ui_4 from krb5_int32 to match krb5_gss_ctx_id_rec struct. * gssapiP_krb5.h, util_crypt.c, util_seqnum.c: kg_make_seq_num(), kg_get_seq_num() changed to use krb5_ui_4 for sequence numbers. kg_encrypt(), kg_decrypt() length argument now unsigned. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15007 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/krb5/ChangeLog | 18 ++++++++++++++++++ src/lib/gssapi/krb5/accept_sec_context.c | 3 ++- src/lib/gssapi/krb5/export_name.c | 2 +- src/lib/gssapi/krb5/gssapiP_krb5.h | 8 ++++---- src/lib/gssapi/krb5/k5seal.c | 2 +- src/lib/gssapi/krb5/k5unseal.c | 2 +- src/lib/gssapi/krb5/util_crypt.c | 4 ++-- src/lib/gssapi/krb5/util_seqnum.c | 4 ++-- 8 files changed, 31 insertions(+), 12 deletions(-) diff --git a/src/lib/gssapi/krb5/ChangeLog b/src/lib/gssapi/krb5/ChangeLog index fb5dbf13d..f649da399 100644 --- a/src/lib/gssapi/krb5/ChangeLog +++ b/src/lib/gssapi/krb5/ChangeLog @@ -1,3 +1,21 @@ +2002-11-15 Ezra Peisach + + * accept_sec_context.c (krb5_gss_accept_sec_context): Use unsigned + lengths for arguments to g_token_size and g_make_token_header. + + * export_name.c (krb5_gss_export_name): Change local length + variable to unsigned. + + * k5unseal.c (kg_unseal_v1): Seqnum variable changed from + krb5_int32 to krb5_ui_4. + + * k5seal.c (make_seal_token_v1): Change seqnum argument to + krb5_ui_4 from krb5_int32 to match krb5_gss_ctx_id_rec struct. + + * gssapiP_krb5.h, util_crypt.c, util_seqnum.c: kg_make_seq_num(), + kg_get_seq_num() changed to use krb5_ui_4 for sequence + numbers. kg_encrypt(), kg_decrypt() length argument now unsigned. + 2002-10-07 Sam Hartman * Makefile.in : Add install-headers support diff --git a/src/lib/gssapi/krb5/accept_sec_context.c b/src/lib/gssapi/krb5/accept_sec_context.c index 5ba8bc820..c0efb3db1 100644 --- a/src/lib/gssapi/krb5/accept_sec_context.c +++ b/src/lib/gssapi/krb5/accept_sec_context.c @@ -842,7 +842,8 @@ krb5_gss_accept_sec_context(minor_status, context_handle, } if (cred && (gss_flags & GSS_C_MUTUAL_FLAG)) { - int tmsglen, toktype; + unsigned int tmsglen; + int toktype; /* * The client is expecting a response, so we can send an diff --git a/src/lib/gssapi/krb5/export_name.c b/src/lib/gssapi/krb5/export_name.c index 5671e5e9a..cab284cc3 100644 --- a/src/lib/gssapi/krb5/export_name.c +++ b/src/lib/gssapi/krb5/export_name.c @@ -33,7 +33,7 @@ OM_uint32 krb5_gss_export_name(OM_uint32 *minor_status, { krb5_context context; krb5_error_code code; - int length; + size_t length; char *str, *cp; if (GSS_ERROR(kg_get_context(minor_status, &context))) diff --git a/src/lib/gssapi/krb5/gssapiP_krb5.h b/src/lib/gssapi/krb5/gssapiP_krb5.h index a51db06bb..3b5bf17e1 100644 --- a/src/lib/gssapi/krb5/gssapiP_krb5.h +++ b/src/lib/gssapi/krb5/gssapiP_krb5.h @@ -214,13 +214,13 @@ krb5_error_code kg_checksum_channel_bindings krb5_error_code kg_make_seq_num (krb5_context context, krb5_keyblock *key, - int direction, krb5_int32 seqnum, unsigned char *cksum, + int direction, krb5_ui_4 seqnum, unsigned char *cksum, unsigned char *buf); krb5_error_code kg_get_seq_num (krb5_context context, krb5_keyblock *key, unsigned char *cksum, unsigned char *buf, int *direction, - krb5_int32 *seqnum); + krb5_ui_4 *seqnum); krb5_error_code kg_make_seed (krb5_context context, krb5_keyblock *key, @@ -236,7 +236,7 @@ krb5_error_code kg_encrypt (krb5_context context, krb5_pointer iv, krb5_pointer in, krb5_pointer out, - int length); + unsigned int length); krb5_error_code kg_arcfour_docrypt (const krb5_keyblock *longterm_key , int ms_usage, const unsigned char *kd_data, size_t kd_data_len, @@ -248,7 +248,7 @@ krb5_error_code kg_decrypt (krb5_context context, krb5_pointer iv, krb5_pointer in, krb5_pointer out, - int length); + unsigned int length); OM_uint32 kg_seal (krb5_context context, OM_uint32 *minor_status, diff --git a/src/lib/gssapi/krb5/k5seal.c b/src/lib/gssapi/krb5/k5seal.c index 6631961a4..3c8702a55 100644 --- a/src/lib/gssapi/krb5/k5seal.c +++ b/src/lib/gssapi/krb5/k5seal.c @@ -54,7 +54,7 @@ static krb5_error_code make_seal_token_v1 (krb5_context context, krb5_keyblock *enc, krb5_keyblock *seq, - krb5_int32 *seqnum, + krb5_ui_4 *seqnum, int direction, gss_buffer_t text, gss_buffer_t token, diff --git a/src/lib/gssapi/krb5/k5unseal.c b/src/lib/gssapi/krb5/k5unseal.c index d51c608e0..347d6b852 100644 --- a/src/lib/gssapi/krb5/k5unseal.c +++ b/src/lib/gssapi/krb5/k5unseal.c @@ -83,7 +83,7 @@ kg_unseal_v1(context, minor_status, ctx, ptr, bodysize, message_buffer, int cksum_len = 0; int plainlen; int direction; - krb5_int32 seqnum; + krb5_ui_4 seqnum; OM_uint32 retval; size_t sumlen; krb5_keyusage sign_usage = KG_USAGE_SIGN; diff --git a/src/lib/gssapi/krb5/util_crypt.c b/src/lib/gssapi/krb5/util_crypt.c index bf30ccc6f..ec2f25375 100644 --- a/src/lib/gssapi/krb5/util_crypt.c +++ b/src/lib/gssapi/krb5/util_crypt.c @@ -98,7 +98,7 @@ kg_encrypt(context, key, usage, iv, in, out, length) krb5_pointer iv; krb5_pointer in; krb5_pointer out; - int length; + unsigned int length; { krb5_error_code code; size_t blocksize; @@ -142,7 +142,7 @@ kg_decrypt(context, key, usage, iv, in, out, length) krb5_pointer iv; krb5_pointer in; krb5_pointer out; - int length; + unsigned int length; { krb5_error_code code; size_t blocksize; diff --git a/src/lib/gssapi/krb5/util_seqnum.c b/src/lib/gssapi/krb5/util_seqnum.c index 4b44b8e5c..ec7da5567 100644 --- a/src/lib/gssapi/krb5/util_seqnum.c +++ b/src/lib/gssapi/krb5/util_seqnum.c @@ -33,7 +33,7 @@ kg_make_seq_num(context, key, direction, seqnum, cksum, buf) krb5_context context; krb5_keyblock *key; int direction; - krb5_int32 seqnum; + krb5_ui_4 seqnum; unsigned char *cksum; unsigned char *buf; { @@ -70,7 +70,7 @@ krb5_error_code kg_get_seq_num(context, key, cksum, buf, direction, seqnum) unsigned char *cksum; unsigned char *buf; int *direction; - krb5_int32 *seqnum; + krb5_ui_4 *seqnum; { krb5_error_code code; unsigned char plain[8]; -- 2.26.2