svn rev #21549: branches/mskrb-integ/src/lib/gssapi/krb5/
lhoward@MIT.EDU
lhoward at MIT.EDU
Thu Dec 18 20:39:45 EST 2008
http://src.mit.edu/fisheye/changelog/krb5/?cs=21549
Commit By: lhoward
Log Message:
Fix a bunch of warnings
Changed Files:
U branches/mskrb-integ/src/lib/gssapi/krb5/accept_sec_context.c
U branches/mskrb-integ/src/lib/gssapi/krb5/disp_status.c
U branches/mskrb-integ/src/lib/gssapi/krb5/export_name.c
U branches/mskrb-integ/src/lib/gssapi/krb5/export_sec_context.c
U branches/mskrb-integ/src/lib/gssapi/krb5/gssapiP_krb5.h
U branches/mskrb-integ/src/lib/gssapi/krb5/gssapi_krb5.hin
U branches/mskrb-integ/src/lib/gssapi/krb5/init_sec_context.c
U branches/mskrb-integ/src/lib/gssapi/krb5/inq_context.c
U branches/mskrb-integ/src/lib/gssapi/krb5/k5seal.c
U branches/mskrb-integ/src/lib/gssapi/krb5/k5sealv3.c
U branches/mskrb-integ/src/lib/gssapi/krb5/k5unseal.c
U branches/mskrb-integ/src/lib/gssapi/krb5/k5unsealiov.c
U branches/mskrb-integ/src/lib/gssapi/krb5/krb5_gss_glue.c
U branches/mskrb-integ/src/lib/gssapi/krb5/lucid_context.c
U branches/mskrb-integ/src/lib/gssapi/krb5/ser_sctx.c
Modified: branches/mskrb-integ/src/lib/gssapi/krb5/accept_sec_context.c
===================================================================
--- branches/mskrb-integ/src/lib/gssapi/krb5/accept_sec_context.c 2008-12-18 23:49:24 UTC (rev 21548)
+++ branches/mskrb-integ/src/lib/gssapi/krb5/accept_sec_context.c 2008-12-19 01:39:42 UTC (rev 21549)
@@ -350,7 +350,7 @@
krb5_keyblock **seq)
{
krb5_error_code code;
- int i;
+ unsigned int i;
switch(subkey->enctype) {
case ENCTYPE_DES_CBC_MD5:
@@ -410,7 +410,7 @@
krb5_context context;
unsigned char *ptr, *ptr2;
char *sptr;
- long tmp;
+ OM_uint32 tmp;
size_t md5len;
int bigend;
krb5_gss_cred_id_t cred = 0;
@@ -570,7 +570,7 @@
if ((code = krb5_auth_con_init(context, &auth_context))) {
major_status = GSS_S_FAILURE;
- save_error_info(code, context);
+ save_error_info((OM_uint32)code, context);
goto fail;
}
if (cred->rcache) {
@@ -950,7 +950,7 @@
krb5_free_ticket(context, ticket); /* Done with ticket */
{
- krb5_ui_4 seq_temp;
+ krb5_int32 seq_temp;
krb5_auth_con_getremoteseqnumber(context, auth_context, &seq_temp);
ctx->seq_recv = seq_temp;
}
@@ -981,7 +981,7 @@
if (ctx->gss_flags & GSS_C_MUTUAL_FLAG) {
unsigned char * ptr3;
- krb5_ui_4 seq_temp;
+ krb5_int32 seq_temp;
int cfx_generate_subkey;
if (ctx->proto == 1 || (ctx->gss_flags & GSS_C_DCE_STYLE))
Modified: branches/mskrb-integ/src/lib/gssapi/krb5/disp_status.c
===================================================================
--- branches/mskrb-integ/src/lib/gssapi/krb5/disp_status.c 2008-12-18 23:49:24 UTC (rev 21548)
+++ branches/mskrb-integ/src/lib/gssapi/krb5/disp_status.c 2008-12-19 01:39:42 UTC (rev 21549)
@@ -46,7 +46,7 @@
char *get_error_message(OM_uint32 minor_code)
{
gsserrmap *p = k5_getspecific(K5_KEY_GSS_KRB5_ERROR_MESSAGE);
- char *msg = 0;
+ char *msg = NULL;
#ifdef DEBUG
fprintf(stderr, "%s(%lu, p=%p)", __func__, (unsigned long) minor_code,
(void *) p);
@@ -61,7 +61,7 @@
}
}
if (msg == 0)
- msg = error_message(minor_code);
+ msg = (char *)error_message((krb5_error_code)minor_code);
#ifdef DEBUG
fprintf(stderr, " -> %p/%s\n", (void *) msg, msg);
#endif
@@ -134,7 +134,7 @@
fprintf(stderr, "%s(%lu, ctx=%p)\n", __func__,
(unsigned long) minor_code, (void *)ctx);
#endif
- s = krb5_get_error_message(ctx, minor_code);
+ s = (char *)krb5_get_error_message(ctx, (krb5_error_code)minor_code);
#ifdef DEBUG
fprintf(stderr, "%s(%lu, ctx=%p) saving: %s\n", __func__,
(unsigned long) minor_code, (void *)ctx, s);
@@ -142,7 +142,7 @@
save_error_string(minor_code, s);
/* The get_error_message call above resets the error message in
ctx. Put it back, in case we make this call again *sigh*. */
- krb5_set_error_message(ctx, minor_code, "%s", s);
+ krb5_set_error_message(ctx, (krb5_error_code)minor_code, "%s", s);
krb5_free_error_message(ctx, s);
}
void krb5_gss_delete_error_info(void *p)
Modified: branches/mskrb-integ/src/lib/gssapi/krb5/export_name.c
===================================================================
--- branches/mskrb-integ/src/lib/gssapi/krb5/export_name.c 2008-12-18 23:49:24 UTC (rev 21548)
+++ branches/mskrb-integ/src/lib/gssapi/krb5/export_name.c 2008-12-19 01:39:42 UTC (rev 21549)
@@ -35,7 +35,8 @@
krb5_context context;
krb5_error_code code;
size_t length;
- char *str, *cp;
+ char *str;
+ unsigned char *cp;
if (minor_status)
*minor_status = 0;
@@ -61,7 +62,7 @@
&str))) {
if (minor_status)
*minor_status = code;
- save_error_info(code, context);
+ save_error_info((OM_uint32)code, context);
krb5_free_context(context);
return(GSS_S_FAILURE);
}
Modified: branches/mskrb-integ/src/lib/gssapi/krb5/export_sec_context.c
===================================================================
--- branches/mskrb-integ/src/lib/gssapi/krb5/export_sec_context.c 2008-12-18 23:49:24 UTC (rev 21548)
+++ branches/mskrb-integ/src/lib/gssapi/krb5/export_sec_context.c 2008-12-19 01:39:42 UTC (rev 21549)
@@ -95,7 +95,7 @@
error_out:
if (retval != GSS_S_COMPLETE)
if (kret != 0 && context != 0)
- save_error_info(kret, context);
+ save_error_info((OM_uint32)kret, context);
if (obuffer && bufsize) {
memset(obuffer, 0, bufsize);
xfree(obuffer);
Modified: branches/mskrb-integ/src/lib/gssapi/krb5/gssapiP_krb5.h
===================================================================
--- branches/mskrb-integ/src/lib/gssapi/krb5/gssapiP_krb5.h 2008-12-18 23:49:24 UTC (rev 21548)
+++ branches/mskrb-integ/src/lib/gssapi/krb5/gssapiP_krb5.h 2008-12-19 01:39:42 UTC (rev 21549)
@@ -889,6 +889,8 @@
OM_uint32 krb5int_gss_use_kdc_context(OM_uint32 *, const gss_OID,
const gss_OID, gss_buffer_t);
+krb5_error_code krb5_gss_use_kdc_context(void);
+
#define GSS_KRB5_REGISTER_ACCEPTOR_IDENTITY_OID_LENGTH 9
#define GSS_KRB5_REGISTER_ACCEPTOR_IDENTITY_OID "\x2b\x06\x01\x04\x01\xa9\x4a\x13\x09"
Modified: branches/mskrb-integ/src/lib/gssapi/krb5/gssapi_krb5.hin
===================================================================
--- branches/mskrb-integ/src/lib/gssapi/krb5/gssapi_krb5.hin 2008-12-18 23:49:24 UTC (rev 21548)
+++ branches/mskrb-integ/src/lib/gssapi/krb5/gssapi_krb5.hin 2008-12-19 01:39:42 UTC (rev 21549)
@@ -268,10 +268,10 @@
OM_uint32 KRB5_CALLCONV
-gsskrb5_extract_authz_data_set_from_sec_context(OM_uint32 *minor_status,
- const gss_ctx_id_t context_handle,
- int ad_type,
- gss_buffer_t ad_data);
+gsskrb5_extract_authz_data_from_sec_context(OM_uint32 *minor_status,
+ const gss_ctx_id_t context_handle,
+ int ad_type,
+ gss_buffer_t ad_data);
OM_uint32 KRB5_CALLCONV
gss_krb5_set_cred_rcache(OM_uint32 *minor_status,
Modified: branches/mskrb-integ/src/lib/gssapi/krb5/init_sec_context.c
===================================================================
--- branches/mskrb-integ/src/lib/gssapi/krb5/init_sec_context.c 2008-12-18 23:49:24 UTC (rev 21548)
+++ branches/mskrb-integ/src/lib/gssapi/krb5/init_sec_context.c 2008-12-19 01:39:42 UTC (rev 21549)
@@ -483,7 +483,7 @@
krb5_context context)
{
krb5_error_code code;
- int i;
+ size_t i;
if (ctx->proto > 0) {
return GSS_S_COMPLETE; /* CFX handles acceptor_subkey directly */
@@ -859,7 +859,7 @@
if (code)
goto fail;
if (krb_error->error)
- code = krb_error->error + ERROR_TABLE_BASE_krb5;
+ code = (krb5_error_code)krb_error->error + ERROR_TABLE_BASE_krb5;
else
code = 0;
krb5_free_error(context, krb_error);
Modified: branches/mskrb-integ/src/lib/gssapi/krb5/inq_context.c
===================================================================
--- branches/mskrb-integ/src/lib/gssapi/krb5/inq_context.c 2008-12-18 23:49:24 UTC (rev 21548)
+++ branches/mskrb-integ/src/lib/gssapi/krb5/inq_context.c 2008-12-19 01:39:42 UTC (rev 21549)
@@ -254,7 +254,8 @@
{
OM_uint32 major_status;
krb5_gss_ctx_id_rec *ctx;
- int ad_type = 0, i;
+ int ad_type = 0;
+ size_t i;
unsigned char *cp;
*data_set = GSS_C_NO_BUFFER_SET;
Modified: branches/mskrb-integ/src/lib/gssapi/krb5/k5seal.c
===================================================================
--- branches/mskrb-integ/src/lib/gssapi/krb5/k5seal.c 2008-12-18 23:49:24 UTC (rev 21548)
+++ branches/mskrb-integ/src/lib/gssapi/krb5/k5seal.c 2008-12-19 01:39:42 UTC (rev 21549)
@@ -79,7 +79,7 @@
* we plan to write out to the token.
* tlen is the length of the token
* including header. */
- unsigned conflen=0, tmsglen, tlen, msglen;
+ unsigned int conflen=0, tmsglen, tlen, msglen;
unsigned char *t, *ptr;
unsigned char *plain;
unsigned char pad;
@@ -246,8 +246,8 @@
/* create the seq_num */
- if ((code = kg_make_seq_num(context, seq, direction?0:0xff, *seqnum,
- ptr+14, ptr+6))) {
+ if ((code = kg_make_seq_num(context, seq, direction?0:0xff,
+ (krb5_ui_4)*seqnum, ptr+14, ptr+6))) {
xfree (plain);
xfree(t);
return(code);
Modified: branches/mskrb-integ/src/lib/gssapi/krb5/k5sealv3.c
===================================================================
--- branches/mskrb-integ/src/lib/gssapi/krb5/k5sealv3.c 2008-12-18 23:49:24 UTC (rev 21548)
+++ branches/mskrb-integ/src/lib/gssapi/krb5/k5sealv3.c 2008-12-19 01:39:42 UTC (rev 21549)
@@ -159,7 +159,7 @@
memset(plain.data + message->length, 'x', ec);
memcpy(plain.data + message->length + ec, outbuf, 16);
- cipher.ciphertext.data = outbuf + 16;
+ cipher.ciphertext.data = (char *)outbuf + 16;
cipher.ciphertext.length = bufsize - 16;
cipher.enctype = key->enctype;
err = krb5_c_encrypt(context, key, key_usage, 0, &plain, &cipher);
@@ -339,7 +339,7 @@
return GSS_S_DEFECTIVE_TOKEN;
}
if ((ptr[2] & FLAG_SENDER_IS_ACCEPTOR) != acceptor_flag) {
- *minor_status = G_BAD_DIRECTION;
+ *minor_status = (OM_uint32)G_BAD_DIRECTION;
return GSS_S_BAD_SIG;
}
@@ -390,7 +390,7 @@
be larger than the plaintext size. */
cipher.enctype = key->enctype;
cipher.ciphertext.length = bodysize - 16;
- cipher.ciphertext.data = ptr + 16;
+ cipher.ciphertext.data = (char *)ptr + 16;
plain.length = bodysize - 16;
plain.data = malloc(plain.length);
if (plain.data == NULL)
@@ -404,7 +404,7 @@
/* Don't use bodysize here! Use the fact that
cipher.ciphertext.length has been adjusted to the
correct length. */
- althdr = plain.data + plain.length - 16;
+ althdr = (unsigned char *)plain.data + plain.length - 16;
if (load_16_be(althdr) != KG2_TOK_WRAP_MSG
|| althdr[2] != ptr[2]
|| althdr[3] != ptr[3]
@@ -433,7 +433,7 @@
store_16_be(0, ptr+4);
store_16_be(0, ptr+6);
plain.length = bodysize-ec;
- plain.data = ptr;
+ plain.data = (char *)ptr;
if (!gss_krb5int_rotate_left(ptr, bodysize-ec, 16))
goto no_mem;
sum.length = ec;
@@ -500,7 +500,7 @@
} else if (toktype == KG_TOK_DEL_CTX) {
if (load_16_be(ptr) != KG2_TOK_DEL_CTX)
goto defective;
- message_buffer = &empty_message;
+ message_buffer = (gss_buffer_t)&empty_message;
goto verify_mic_1;
} else {
goto defective;
Modified: branches/mskrb-integ/src/lib/gssapi/krb5/k5unseal.c
===================================================================
--- branches/mskrb-integ/src/lib/gssapi/krb5/k5unseal.c 2008-12-18 23:49:24 UTC (rev 21548)
+++ branches/mskrb-integ/src/lib/gssapi/krb5/k5unseal.c 2008-12-19 01:39:42 UTC (rev 21549)
@@ -165,7 +165,7 @@
/* decode the message, if SEAL */
if (toktype == KG_TOK_SEAL_MSG) {
- int tmsglen = bodysize-(14+cksum_len);
+ size_t tmsglen = bodysize-(14+cksum_len);
if (sealalg != 0xffff) {
if ((plain = (unsigned char *) xmalloc(tmsglen)) == NULL) {
*minor_status = ENOMEM;
@@ -463,11 +463,11 @@
message_buffer->value = NULL;
message_buffer->length = 0;
}
- *minor_status = G_BAD_DIRECTION;
+ *minor_status = (OM_uint32)G_BAD_DIRECTION;
return(GSS_S_BAD_SIG);
}
- retval = g_order_check(&(ctx->seqstate), seqnum);
+ retval = g_order_check(&(ctx->seqstate), (gssint_uint64)seqnum);
/* success or ordering violation */
Modified: branches/mskrb-integ/src/lib/gssapi/krb5/k5unsealiov.c
===================================================================
--- branches/mskrb-integ/src/lib/gssapi/krb5/k5unsealiov.c 2008-12-18 23:49:24 UTC (rev 21548)
+++ branches/mskrb-integ/src/lib/gssapi/krb5/k5unsealiov.c 2008-12-19 01:39:42 UTC (rev 21549)
@@ -378,7 +378,7 @@
if (ctx->proto == 0)
code = kg_unseal_v1_iov(context, minor_status, ctx, iov, iov_count,
- (ptr - (unsigned char *)header->buffer.value),
+ (size_t)(ptr - (unsigned char *)header->buffer.value),
conf_state, qop_state, toktype);
else
code = gss_krb5int_unseal_v3_iov(context, minor_status, ctx, iov, iov_count,
@@ -436,7 +436,7 @@
goto cleanup;
}
- tiov = (gss_iov_buffer_desc *)calloc(iov_count + 2, sizeof(gss_iov_buffer_desc));
+ tiov = (gss_iov_buffer_desc *)calloc((size_t)iov_count + 2, sizeof(gss_iov_buffer_desc));
if (tiov == NULL) {
code = ENOMEM;
goto cleanup;
Modified: branches/mskrb-integ/src/lib/gssapi/krb5/krb5_gss_glue.c
===================================================================
--- branches/mskrb-integ/src/lib/gssapi/krb5/krb5_gss_glue.c 2008-12-18 23:49:24 UTC (rev 21548)
+++ branches/mskrb-integ/src/lib/gssapi/krb5/krb5_gss_glue.c 2008-12-19 01:39:42 UTC (rev 21549)
@@ -94,14 +94,14 @@
}
};
-OM_uint32
+static OM_uint32
krb5_gss_inquire_sec_context_by_oid (OM_uint32 *minor_status,
const gss_ctx_id_t context_handle,
const gss_OID desired_object,
gss_buffer_set_t *data_set)
{
krb5_gss_ctx_id_rec *ctx;
- int i;
+ size_t i;
if (minor_status == NULL)
return GSS_S_CALL_INACCESSIBLE_WRITE;
@@ -148,7 +148,7 @@
} krb5_gss_inquire_cred_by_oid_ops[] = {
};
-OM_uint32
+static OM_uint32
krb5_gss_inquire_cred_by_oid(OM_uint32 *minor_status,
const gss_cred_id_t cred_handle,
const gss_OID desired_object,
@@ -156,7 +156,7 @@
{
OM_uint32 major_status = GSS_S_FAILURE;
krb5_gss_cred_id_t cred;
- int i;
+ size_t i;
if (minor_status == NULL)
return GSS_S_CALL_INACCESSIBLE_WRITE;
@@ -171,7 +171,7 @@
*data_set = GSS_C_NO_BUFFER_SET;
if (cred_handle == GSS_C_NO_CREDENTIAL) {
- *minor_status = KRB5_NOCREDS_SUPPLIED;
+ *minor_status = (OM_uint32)KRB5_NOCREDS_SUPPLIED;
return GSS_S_NO_CRED;
}
@@ -205,13 +205,13 @@
} krb5_gss_set_sec_context_option_ops[] = {
};
-OM_uint32
+static OM_uint32
krb5_gss_set_sec_context_option (OM_uint32 *minor_status,
gss_ctx_id_t *context_handle,
const gss_OID desired_object,
const gss_buffer_t value)
{
- int i;
+ size_t i;
if (minor_status == NULL)
return GSS_S_CALL_INACCESSIBLE_WRITE;
@@ -272,14 +272,14 @@
}
};
-OM_uint32
+static OM_uint32
krb5_gssspi_set_cred_option(OM_uint32 *minor_status,
gss_cred_id_t cred_handle,
const gss_OID desired_object,
const gss_buffer_t value)
{
OM_uint32 major_status = GSS_S_FAILURE;
- int i;
+ size_t i;
if (minor_status == NULL)
return GSS_S_CALL_INACCESSIBLE_WRITE;
@@ -287,7 +287,7 @@
*minor_status = 0;
if (cred_handle == GSS_C_NO_CREDENTIAL) {
- *minor_status = KRB5_NOCREDS_SUPPLIED;
+ *minor_status = (OM_uint32)KRB5_NOCREDS_SUPPLIED;
return GSS_S_NO_CRED;
}
@@ -338,13 +338,13 @@
}
};
-OM_uint32
+static OM_uint32
krb5_gssspi_mech_invoke (OM_uint32 *minor_status,
const gss_OID desired_mech,
const gss_OID desired_object,
gss_buffer_t value)
{
- int i;
+ size_t i;
if (minor_status == NULL)
return GSS_S_CALL_INACCESSIBLE_WRITE;
Modified: branches/mskrb-integ/src/lib/gssapi/krb5/lucid_context.c
===================================================================
--- branches/mskrb-integ/src/lib/gssapi/krb5/lucid_context.c 2008-12-18 23:49:24 UTC (rev 21548)
+++ branches/mskrb-integ/src/lib/gssapi/krb5/lucid_context.c 2008-12-19 01:39:42 UTC (rev 21549)
@@ -72,7 +72,8 @@
krb5_gss_ctx_id_t ctx = (krb5_gss_ctx_id_t)context_handle;
void *lctx = NULL;
unsigned char *cp;
- int version, i;
+ unsigned int version = 0;
+ size_t i;
gss_buffer_desc rep;
/* Assume failure */
Modified: branches/mskrb-integ/src/lib/gssapi/krb5/ser_sctx.c
===================================================================
--- branches/mskrb-integ/src/lib/gssapi/krb5/ser_sctx.c 2008-12-18 23:49:24 UTC (rev 21548)
+++ branches/mskrb-integ/src/lib/gssapi/krb5/ser_sctx.c 2008-12-19 01:39:42 UTC (rev 21549)
@@ -99,7 +99,7 @@
return EINVAL;
}
oid->length = ibuf;
- oid->elements = malloc(ibuf);
+ oid->elements = malloc((size_t)ibuf);
if (oid->elements == 0) {
free(oid);
return ENOMEM;
@@ -570,8 +570,8 @@
ctx->krb_times.renew_till = (krb5_timestamp) ibuf;
(void) krb5_ser_unpack_int32(&ibuf, &bp, &remain);
ctx->krb_flags = (krb5_flags) ibuf;
- (void) (*kaccess.krb5_ser_unpack_int64)(&ctx->seq_send, &bp, &remain);
- kret = (*kaccess.krb5_ser_unpack_int64)(&ctx->seq_recv, &bp, &remain);
+ (void) (*kaccess.krb5_ser_unpack_int64)((krb5_int64 *)&ctx->seq_send, &bp, &remain);
+ kret = (*kaccess.krb5_ser_unpack_int64)((krb5_int64 *)&ctx->seq_recv, &bp, &remain);
if (kret) {
free(ctx);
return kret;
More information about the cvs-krb5
mailing list