From e9ab93cf411fd8805f14e5b28717a3f303c212da Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Sat, 23 Sep 1995 02:16:21 +0000 Subject: [PATCH] acquire_.c: changed int to size_t. gssapip_.h: added prototype for kg_seal_size. k5seal.c: 16/32 bit mismatch and removed unused variables. seal.c: 16/32 bit mismatch. sign.c: 16/32 bit mismatch. ser_sctx.c: added prototypes for all functions since they get assigned into a structure that has been prototyped. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6833 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/krb5/ChangeLog | 10 ++++++ src/lib/gssapi/krb5/acquire_cred.c | 2 +- src/lib/gssapi/krb5/gssapiP_krb5.h | 7 ++++ src/lib/gssapi/krb5/k5seal.c | 3 +- src/lib/gssapi/krb5/seal.c | 2 +- src/lib/gssapi/krb5/ser_sctx.c | 55 ++++++++++++++++++++++++++++++ src/lib/gssapi/krb5/sign.c | 2 +- 7 files changed, 76 insertions(+), 5 deletions(-) diff --git a/src/lib/gssapi/krb5/ChangeLog b/src/lib/gssapi/krb5/ChangeLog index 4ce7115ce..431cb82ee 100644 --- a/src/lib/gssapi/krb5/ChangeLog +++ b/src/lib/gssapi/krb5/ChangeLog @@ -1,3 +1,13 @@ +Wed Sep 13 10:39:13 1995 Keith Vetter (keithv@fusion.com) + + * acquire_.c: changed int to size_t. + * gssapip_.h: added prototype for kg_seal_size. + * k5seal.c: 16/32 bit mismatch and removed unused variables. + * seal.c: 16/32 bit mismatch. + * sign.c: 16/32 bit mismatch. + * ser_sctx.c: added prototypes for all functions since they get + assigned into a structure that has been prototyped. + Sat Sep 16 03:18:02 1995 Theodore Y. Ts'o * gssapiP_krb5.h: Remove context and cred from the gssapi security diff --git a/src/lib/gssapi/krb5/acquire_cred.c b/src/lib/gssapi/krb5/acquire_cred.c index 9cbb0b68e..bdc8964cb 100644 --- a/src/lib/gssapi/krb5/acquire_cred.c +++ b/src/lib/gssapi/krb5/acquire_cred.c @@ -251,7 +251,7 @@ krb5_gss_acquire_cred(context, minor_status, desired_name, time_req, gss_OID_set *actual_mechs; OM_uint32 *time_rec; { - int i; + size_t i; krb5_gss_cred_id_t cred; gss_OID_set mechs; OM_uint32 ret; diff --git a/src/lib/gssapi/krb5/gssapiP_krb5.h b/src/lib/gssapi/krb5/gssapiP_krb5.h index 35f78e1f8..41e0a1b93 100644 --- a/src/lib/gssapi/krb5/gssapiP_krb5.h +++ b/src/lib/gssapi/krb5/gssapiP_krb5.h @@ -168,6 +168,13 @@ OM_uint32 kg_unseal PROTOTYPE((krb5_context context, int *qop_state, int toktype)); +OM_uint32 kg_seal_size PROTOTYPE((OM_uint32 *minor_status, + gss_ctx_id_t context_handle, + int conf_req_flag, + gss_qop_t qop_req, + OM_uint32 output_size, + OM_uint32 *input_size)); + krb5_error_code kg_ser_context_init PROTOTYPE((krb5_context)); diff --git a/src/lib/gssapi/krb5/k5seal.c b/src/lib/gssapi/krb5/k5seal.c index 1653a4553..d05898473 100644 --- a/src/lib/gssapi/krb5/k5seal.c +++ b/src/lib/gssapi/krb5/k5seal.c @@ -253,7 +253,6 @@ kg_seal_size(context, minor_status, context_handle, conf_req_flag, qop_req, OM_uint32 *input_size; { krb5_gss_ctx_id_rec *ctx; - krb5_error_code code; OM_uint32 cfsize; OM_uint32 ohlen; @@ -277,7 +276,7 @@ kg_seal_size(context, minor_status, context_handle, conf_req_flag, qop_req, /* Calculate the token size and subtract that from the output size */ cfsize = (conf_req_flag) ? kg_confounder_size(&ctx->enc) : 0; - ohlen = g_token_size((gss_OID) gss_mech_krb5, cfsize + 22); + ohlen = g_token_size((gss_OID) gss_mech_krb5, (unsigned int) cfsize + 22); /* Cannot have trailer length that will cause us to pad over our length */ *input_size = (output_size - ohlen) & (~7); diff --git a/src/lib/gssapi/krb5/seal.c b/src/lib/gssapi/krb5/seal.c index 49c726d12..14f203ae2 100644 --- a/src/lib/gssapi/krb5/seal.c +++ b/src/lib/gssapi/krb5/seal.c @@ -55,7 +55,7 @@ krb5_gss_wrap(context, minor_status, context_handle, conf_req_flag, gss_buffer_t output_message_buffer; { return(kg_seal(context, minor_status, context_handle, conf_req_flag, - qop_req, input_message_buffer, conf_state, + (int) qop_req, input_message_buffer, conf_state, output_message_buffer, KG_TOK_WRAP_MSG)); } diff --git a/src/lib/gssapi/krb5/ser_sctx.c b/src/lib/gssapi/krb5/ser_sctx.c index 4cd0e7d35..7b64f7421 100644 --- a/src/lib/gssapi/krb5/ser_sctx.c +++ b/src/lib/gssapi/krb5/ser_sctx.c @@ -32,6 +32,61 @@ * krb5_gss_enc_desc and krb5_gss_ctx_id_t. */ + +/* Windows needs these prototypes since the structure they're assigned + * into is prototyped. + */ +static krb5_error_code kg_cred_size + PROTOTYPE((krb5_context kcontext, + krb5_pointer arg, + size_t *sizep)); + +static krb5_error_code kg_cred_externalize + PROTOTYPE((krb5_context kcontext, + krb5_pointer arg, + krb5_octet **buffer, + size_t *lenremain)); + +static krb5_error_code kg_cred_internalize + PROTOTYPE((krb5_context kcontext, + krb5_pointer *argp, + krb5_octet **buffer, + size_t *lenremain)); + +static krb5_error_code kg_enc_desc_size + PROTOTYPE((krb5_context kcontext, + krb5_pointer arg, + size_t *sizep)); + +static krb5_error_code kg_enc_desc_externalize + PROTOTYPE((krb5_context kcontext, + krb5_pointer arg, + krb5_octet **buffer, + size_t *lenremain)); + +static krb5_error_code kg_enc_desc_internalize + PROTOTYPE((krb5_context kcontext, + krb5_pointer *argp, + krb5_octet **buffer, + size_t *lenremain)); + +static krb5_error_code kg_ctx_size + PROTOTYPE((krb5_context kcontext, + krb5_pointer arg, + size_t *sizep)); + +static krb5_error_code kg_ctx_externalize + PROTOTYPE((krb5_context kcontext, + krb5_pointer arg, + krb5_octet **buffer, + size_t *lenremain)); + +static krb5_error_code kg_ctx_internalize + PROTOTYPE((krb5_context kcontext, + krb5_pointer *argp, + krb5_octet **buffer, + size_t *lenremain)); + /* * Determine the size required for this krb5_gss_cred_id_t. */ diff --git a/src/lib/gssapi/krb5/sign.c b/src/lib/gssapi/krb5/sign.c index 74eab6bca..109213771 100644 --- a/src/lib/gssapi/krb5/sign.c +++ b/src/lib/gssapi/krb5/sign.c @@ -50,6 +50,6 @@ krb5_gss_get_mic(context, minor_status, context_handle, qop_req, gss_buffer_t message_token; { return(kg_seal(context, minor_status, context_handle, 0, - qop_req, message_buffer, NULL, + (int) qop_req, message_buffer, NULL, message_token, KG_TOK_MIC_MSG)); } -- 2.26.2