From 835926c87921a0f4186a9331b6e31b2e6f1c0d90 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 7 May 2006 04:51:30 +0000 Subject: r15481: Update heimdal/ to match current lorikeet-heimdal. This includes many useful upstream changes, many of which should reduce warnings in our compile. It also includes a change to the HDB interface, which removes the need for Samba4/lorikeet-heimdal to deviate from upstream for hdb_fetch(). The new flags replace the old entry type enum. (This required the rework in hdb-ldb.c included in this commit) Andrew Bartlett (This used to be commit ef5604b87744c89e66e4d845f45b23563754ec05) --- source4/heimdal/lib/gssapi/8003.c | 8 +++++--- source4/heimdal/lib/gssapi/arcfour.c | 14 +++++++------- source4/heimdal/lib/gssapi/cfx.c | 11 +++++------ source4/heimdal/lib/gssapi/gssapi.h | 8 ++++---- source4/heimdal/lib/gssapi/gssapi_locl.h | 6 +++--- source4/heimdal/lib/gssapi/init_sec_context.c | 2 +- source4/heimdal/lib/gssapi/wrap.c | 4 ++-- 7 files changed, 27 insertions(+), 26 deletions(-) (limited to 'source4/heimdal/lib/gssapi') diff --git a/source4/heimdal/lib/gssapi/8003.c b/source4/heimdal/lib/gssapi/8003.c index 0062068d5b..ad580811a5 100644 --- a/source4/heimdal/lib/gssapi/8003.c +++ b/source4/heimdal/lib/gssapi/8003.c @@ -33,7 +33,7 @@ #include "gssapi_locl.h" -RCSID("$Id: 8003.c,v 1.17 2005/04/01 08:55:36 lha Exp $"); +RCSID("$Id: 8003.c,v 1.18 2006/05/04 11:55:40 lha Exp $"); krb5_error_code gssapi_encode_om_uint32(OM_uint32 n, u_char *p) @@ -56,15 +56,17 @@ gssapi_encode_be_om_uint32(OM_uint32 n, u_char *p) } krb5_error_code -gssapi_decode_om_uint32(u_char *p, OM_uint32 *n) +gssapi_decode_om_uint32(const void *ptr, OM_uint32 *n) { + const u_char *p = ptr; *n = (p[0] << 0) | (p[1] << 8) | (p[2] << 16) | (p[3] << 24); return 0; } krb5_error_code -gssapi_decode_be_om_uint32(u_char *p, OM_uint32 *n) +gssapi_decode_be_om_uint32(const void *ptr, OM_uint32 *n) { + const u_char *p = ptr; *n = (p[0] <<24) | (p[1] << 16) | (p[2] << 8) | (p[3] << 0); return 0; } diff --git a/source4/heimdal/lib/gssapi/arcfour.c b/source4/heimdal/lib/gssapi/arcfour.c index 01c6c75ecc..936a20d403 100644 --- a/source4/heimdal/lib/gssapi/arcfour.c +++ b/source4/heimdal/lib/gssapi/arcfour.c @@ -33,7 +33,7 @@ #include "gssapi_locl.h" -RCSID("$Id: arcfour.c,v 1.18 2005/11/01 06:55:55 lha Exp $"); +RCSID("$Id: arcfour.c,v 1.19 2006/05/04 11:56:50 lha Exp $"); /* * Implements draft-brezak-win2k-krb-rc4-hmac-04.txt @@ -246,8 +246,8 @@ _gssapi_verify_mic_arcfour(OM_uint32 * minor_status, krb5_error_code ret; int32_t seq_number; OM_uint32 omret; - char cksum_data[8], k6_data[16], SND_SEQ[8]; - u_char *p; + u_char SND_SEQ[8], cksum_data[8], *p; + char k6_data[16]; int cmp; if (qop_state) @@ -295,7 +295,7 @@ _gssapi_verify_mic_arcfour(OM_uint32 * minor_status, { RC4_KEY rc4_key; - RC4_set_key (&rc4_key, sizeof(k6_data), k6_data); + RC4_set_key (&rc4_key, sizeof(k6_data), (void*)k6_data); RC4 (&rc4_key, 8, p, SND_SEQ); memset(&rc4_key, 0, sizeof(rc4_key)); @@ -480,7 +480,7 @@ _gssapi_wrap_arcfour(OM_uint32 * minor_status, if(conf_req_flag) { RC4_KEY rc4_key; - RC4_set_key (&rc4_key, sizeof(k6_data), k6_data); + RC4_set_key (&rc4_key, sizeof(k6_data), (void *)k6_data); /* XXX ? */ RC4 (&rc4_key, 8 + datalen, p0 + 24, p0 + 24); /* Confounder + data */ memset(&rc4_key, 0, sizeof(rc4_key)); @@ -526,8 +526,8 @@ OM_uint32 _gssapi_unwrap_arcfour(OM_uint32 *minor_status, int32_t seq_number; size_t len, datalen; OM_uint32 omret; - char k6_data[16], SND_SEQ[8], Confounder[8]; - char cksum_data[8]; + u_char k6_data[16], SND_SEQ[8], Confounder[8]; + u_char cksum_data[8]; u_char *p, *p0; int cmp; int conf_flag; diff --git a/source4/heimdal/lib/gssapi/cfx.c b/source4/heimdal/lib/gssapi/cfx.c index 3e7592b3a7..1aebd008a6 100755 --- a/source4/heimdal/lib/gssapi/cfx.c +++ b/source4/heimdal/lib/gssapi/cfx.c @@ -32,7 +32,7 @@ #include "gssapi_locl.h" -RCSID("$Id: cfx.c,v 1.17 2005/04/27 17:47:32 lha Exp $"); +RCSID("$Id: cfx.c,v 1.19 2006/05/05 10:26:43 lha Exp $"); /* * Implementation of draft-ietf-krb-wg-gssapi-cfx-06.txt @@ -143,11 +143,10 @@ OM_uint32 _gssapi_wrap_size_cfx(OM_uint32 *minor_status, */ static krb5_error_code -rrc_rotate(void *data, size_t len, u_int16_t rrc, krb5_boolean unrotate) +rrc_rotate(void *data, size_t len, uint16_t rrc, krb5_boolean unrotate) { - u_char *tmp; + u_char *tmp, buf[256]; size_t left; - char buf[256]; if (len == 0) return 0; @@ -220,7 +219,7 @@ OM_uint32 _gssapi_wrap_cfx(OM_uint32 *minor_status, } /* Always rotate encrypted token (if any) and checksum to header */ - rrc = (conf_req_flag ? sizeof(*token) : 0) + (u_int16_t)cksumsize; + rrc = (conf_req_flag ? sizeof(*token) : 0) + (uint16_t)cksumsize; output_message_buffer->length = wrapped_len; output_message_buffer->value = malloc(output_message_buffer->length); @@ -420,7 +419,7 @@ OM_uint32 _gssapi_unwrap_cfx(OM_uint32 *minor_status, krb5_error_code ret; unsigned usage; krb5_data data; - u_int16_t ec, rrc; + uint16_t ec, rrc; OM_uint32 seq_number_lo, seq_number_hi; size_t len; u_char *p; diff --git a/source4/heimdal/lib/gssapi/gssapi.h b/source4/heimdal/lib/gssapi/gssapi.h index b93ad4e481..eac2737f43 100644 --- a/source4/heimdal/lib/gssapi/gssapi.h +++ b/source4/heimdal/lib/gssapi/gssapi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2003 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2006 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: gssapi.h,v 1.39 2005/12/05 11:52:45 lha Exp $ */ +/* $Id: gssapi.h,v 1.40 2006/05/05 11:08:29 lha Exp $ */ #ifndef GSSAPI_H_ #define GSSAPI_H_ @@ -47,9 +47,9 @@ * Now define the three implementation-dependent types. */ -typedef u_int32_t OM_uint32; +typedef uint32_t OM_uint32; -typedef u_int32_t gss_uint32; +typedef uint32_t gss_uint32; /* * This is to avoid having to include diff --git a/source4/heimdal/lib/gssapi/gssapi_locl.h b/source4/heimdal/lib/gssapi/gssapi_locl.h index be2277b96f..81169a8500 100644 --- a/source4/heimdal/lib/gssapi/gssapi_locl.h +++ b/source4/heimdal/lib/gssapi/gssapi_locl.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: gssapi_locl.h,v 1.44 2006/04/12 17:44:05 lha Exp $ */ +/* $Id: gssapi_locl.h,v 1.45 2006/05/04 11:56:14 lha Exp $ */ #ifndef GSSAPI_LOCL_H #define GSSAPI_LOCL_H @@ -307,9 +307,9 @@ krb5_error_code gssapi_encode_be_om_uint32(OM_uint32, u_char *); krb5_error_code -gssapi_decode_om_uint32(u_char *, OM_uint32 *); +gssapi_decode_om_uint32(const void *, OM_uint32 *); krb5_error_code -gssapi_decode_be_om_uint32(u_char *, OM_uint32 *); +gssapi_decode_be_om_uint32(const void *, OM_uint32 *); #endif diff --git a/source4/heimdal/lib/gssapi/init_sec_context.c b/source4/heimdal/lib/gssapi/init_sec_context.c index e363ee22f7..dc937daae5 100644 --- a/source4/heimdal/lib/gssapi/init_sec_context.c +++ b/source4/heimdal/lib/gssapi/init_sec_context.c @@ -33,7 +33,7 @@ #include "gssapi_locl.h" -RCSID("$Id: init_sec_context.c,v 1.62 2006/04/09 18:45:18 lha Exp $"); +RCSID("$Id: init_sec_context.c,v 1.63 2006/05/05 10:27:13 lha Exp $"); /* * copy the addresses from `input_chan_bindings' (if any) to diff --git a/source4/heimdal/lib/gssapi/wrap.c b/source4/heimdal/lib/gssapi/wrap.c index 0c089067b6..7072ca2754 100644 --- a/source4/heimdal/lib/gssapi/wrap.c +++ b/source4/heimdal/lib/gssapi/wrap.c @@ -33,7 +33,7 @@ #include "gssapi_locl.h" -RCSID("$Id: wrap.c,v 1.32 2006/04/02 02:10:03 lha Exp $"); +RCSID("$Id: wrap.c,v 1.33 2006/05/05 10:27:36 lha Exp $"); OM_uint32 gsskrb5_get_initiator_subkey(OM_uint32 *minor_status, @@ -428,7 +428,7 @@ wrap_des3 u_char seq[8]; int32_t seq_number; size_t len, total_len, padlength, datalen; - u_int32_t ret; + uint32_t ret; krb5_crypto crypto; Checksum cksum; krb5_data encdata; -- cgit