[krbdev.mit.edu #6096] Reduce warnings
Alexandra Ellwood via RT
rt-comment at krbdev.mit.edu
Mon Aug 25 16:27:04 EDT 2008
Index: KerberosFramework/Kerberos5/Sources/kim/lib/kim_preferences.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/kim/lib/kim_preferences.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/kim/lib/kim_preferences.c (working copy)
@@ -289,12 +289,14 @@
err = kim_identity_compare (in_identity, identity, &found);
if (!err && found) {
+ kim_error terr = KIM_NO_ERROR;
kim_count new_count = io_favorite_identities->count - 1;
+
memmove (&io_favorite_identities->identities[i],
&io_favorite_identities->identities[i + 1],
(new_count - i) * sizeof (*io_favorite_identities->identities));
- kim_error terr = kim_favorite_identities_resize (io_favorite_identities, new_count);
+ terr = kim_favorite_identities_resize (io_favorite_identities, new_count);
if (terr) {
kim_debug_printf ("failed to resize list to %d. Continuing.", new_count);
}
Index: KerberosFramework/Kerberos5/Sources/kim/lib/mac/kim_os_string.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/kim/lib/mac/kim_os_string.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/kim/lib/mac/kim_os_string.c (working copy)
@@ -35,12 +35,13 @@
{
typedef TextEncoding (*GetApplicationTextEncodingProcPtr) (void);
GetApplicationTextEncodingProcPtr GetApplicationTextEncodingPtr = NULL;
+ CFBundleRef carbonBundle = NULL;
if (kim_os_library_caller_is_server ()) {
return kCFStringEncodingUTF8; /* server only does UTF8 */
}
- CFBundleRef carbonBundle = CFBundleGetBundleWithIdentifier (CFSTR ("com.apple.Carbon"));
+ carbonBundle = CFBundleGetBundleWithIdentifier (CFSTR ("com.apple.Carbon"));
if (carbonBundle != NULL && CFBundleIsExecutableLoaded (carbonBundle)) {
GetApplicationTextEncodingPtr = (GetApplicationTextEncodingProcPtr) CFBundleGetFunctionPointerForName (carbonBundle,
CFSTR ("GetApplicationTextEncoding"));
Index: KerberosFramework/Kerberos5/Sources/include/k5-thread.h
===================================================================
--- KerberosFramework/Kerberos5/Sources/include/k5-thread.h (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/include/k5-thread.h (working copy)
@@ -117,7 +117,7 @@
// Returns error if key out of bounds, or the pointer table can't
// be allocated. A call to k5_key_register must have happened first.
// This may trigger the calling of pthread_setspecific on POSIX.
- int k5_setspecific(k5_key_t, void *);
+ int k5_setspecific(k5_key_t, const void *);
// Called in library termination code.
// Trashes data in all threads, calling the registered destructor
// (but calling it from the current thread).
@@ -746,7 +746,7 @@
#define k5_key_delete krb5int_key_delete
extern int k5_key_register(k5_key_t, void (*)(void *));
extern void *k5_getspecific(k5_key_t);
-extern int k5_setspecific(k5_key_t, void *);
+extern int k5_setspecific(k5_key_t, const void *);
extern int k5_key_delete(k5_key_t);
extern int KRB5_CALLCONV krb5int_mutex_alloc (k5_mutex_t **);
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/coll_proof_cksum.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/coll_proof_cksum.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/coll_proof_cksum.c (working copy)
@@ -30,7 +30,7 @@
krb5_boolean KRB5_CALLCONV
krb5_c_is_coll_proof_cksum(krb5_cksumtype ctype)
{
- int i;
+ unsigned int i;
for (i=0; i<krb5_cksumtypes_length; i++) {
if (krb5_cksumtypes_list[i].ctype == ctype)
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/keyed_cksum.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/keyed_cksum.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/keyed_cksum.c (working copy)
@@ -30,7 +30,7 @@
krb5_boolean KRB5_CALLCONV
krb5_c_is_keyed_cksum(krb5_cksumtype ctype)
{
- int i;
+ unsigned int i;
for (i=0; i<krb5_cksumtypes_length; i++) {
if (krb5_cksumtypes_list[i].ctype == ctype) {
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/cksumtypes.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/cksumtypes.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/cksumtypes.c (working copy)
@@ -94,5 +94,5 @@
&krb5int_hash_sha1, 12 },
};
-const int krb5_cksumtypes_length =
+const unsigned int krb5_cksumtypes_length =
sizeof(krb5_cksumtypes_list)/sizeof(struct krb5_cksumtypes);
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/hmac.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/hmac.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/hmac.c (working copy)
@@ -44,7 +44,7 @@
{
size_t hashsize, blocksize;
unsigned char *xorkey, *ihash;
- int i;
+ unsigned int i;
krb5_data *hashin, hashout;
krb5_error_code ret;
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/cksumtype_to_string.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/cksumtype_to_string.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/cksumtype_to_string.c (working copy)
@@ -30,7 +30,7 @@
krb5_error_code KRB5_CALLCONV
krb5_cksumtype_to_string(krb5_cksumtype cksumtype, char *buffer, size_t buflen)
{
- int i;
+ unsigned int i;
for (i=0; i<krb5_cksumtypes_length; i++) {
if (krb5_cksumtypes_list[i].ctype == cksumtype) {
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/cksumtypes.h
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/cksumtypes.h (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/cksumtypes.h (working copy)
@@ -27,4 +27,4 @@
#include "k5-int.h"
extern const struct krb5_cksumtypes krb5_cksumtypes_list[];
-extern const int krb5_cksumtypes_length;
+extern const unsigned int krb5_cksumtypes_length;
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/string_to_cksumtype.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/string_to_cksumtype.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/string_to_cksumtype.c (working copy)
@@ -30,7 +30,7 @@
krb5_error_code KRB5_CALLCONV
krb5_string_to_cksumtype(char *string, krb5_cksumtype *cksumtypep)
{
- int i;
+ unsigned int i;
for (i=0; i<krb5_cksumtypes_length; i++) {
if (strcasecmp(krb5_cksumtypes_list[i].in_string, string) == 0) {
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/enc_provider/aes.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/enc_provider/aes.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/enc_provider/aes.c (working copy)
@@ -28,6 +28,13 @@
#include "enc_provider.h"
#include "aes.h"
+krb5_error_code
+krb5int_aes_encrypt(const krb5_keyblock *key, const krb5_data *ivec,
+ const krb5_data *input, krb5_data *output);
+krb5_error_code
+krb5int_aes_decrypt(const krb5_keyblock *key, const krb5_data *ivec,
+ const krb5_data *input, krb5_data *output);
+
#if 0
aes_rval aes_blk_len(unsigned int blen, aes_ctx cx[1]);
aes_rval aes_enc_key(const unsigned char in_key[], unsigned int klen, aes_ctx cx[1]);
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/make_checksum.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/make_checksum.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/make_checksum.c (working copy)
@@ -34,7 +34,8 @@
const krb5_keyblock *key, krb5_keyusage usage,
const krb5_data *input, krb5_checksum *cksum)
{
- int i, e1, e2;
+ unsigned int i;
+ int e1, e2;
krb5_data data;
krb5_error_code ret;
size_t cksumlen;
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/checksum_length.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/checksum_length.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/checksum_length.c (working copy)
@@ -31,7 +31,7 @@
krb5_c_checksum_length(krb5_context context, krb5_cksumtype cksumtype,
size_t *length)
{
- int i;
+ unsigned int i;
for (i=0; i<krb5_cksumtypes_length; i++) {
if (krb5_cksumtypes_list[i].ctype == cksumtype)
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/pbkdf2.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/pbkdf2.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/pbkdf2.c (working copy)
@@ -42,7 +42,7 @@
static int debug_hmac = 0;
static void printd (const char *descr, krb5_data *d) {
- int i, j;
+ unsigned int i, j;
const int r = 16;
printf("%s:", descr);
@@ -77,7 +77,7 @@
{
unsigned char ibytes[4];
size_t tlen;
- int j, k;
+ unsigned int j, k;
krb5_keyblock pdata;
krb5_data sdata;
krb5_data out;
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/sha1/shs.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/sha1/shs.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/sha1/shs.c (working copy)
@@ -243,7 +243,8 @@
void shsUpdate(SHS_INFO *shsInfo, const SHS_BYTE *buffer, unsigned int count)
{
SHS_LONG tmp;
- int dataCount, canfill;
+ unsigned int dataCount;
+ int canfill;
SHS_LONG *lp;
/* Update bitcount */
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/keyhash_provider/k5_md4des.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/keyhash_provider/k5_md4des.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/keyhash_provider/k5_md4des.c (working copy)
@@ -48,7 +48,7 @@
krb5_MD4_CTX ctx;
unsigned char conf[CONFLENGTH];
unsigned char xorkey[8];
- int i;
+ unsigned int i;
mit_des_key_schedule schedule;
if (key->length != 8)
@@ -111,7 +111,7 @@
krb5_MD4_CTX ctx;
unsigned char plaintext[CONFLENGTH+RSA_MD4_CKSUM_LENGTH];
unsigned char xorkey[8];
- int i;
+ unsigned int i;
mit_des_key_schedule schedule;
int compathash = 0;
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/keyhash_provider/k5_md5des.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/keyhash_provider/k5_md5des.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/keyhash_provider/k5_md5des.c (working copy)
@@ -48,7 +48,7 @@
krb5_MD5_CTX ctx;
unsigned char conf[CONFLENGTH];
unsigned char xorkey[8];
- int i;
+ unsigned int i;
mit_des_key_schedule schedule;
if (key->length != 8)
@@ -110,7 +110,7 @@
krb5_MD5_CTX ctx;
unsigned char plaintext[CONFLENGTH+RSA_MD5_CKSUM_LENGTH];
unsigned char xorkey[8];
- int i;
+ unsigned int i;
mit_des_key_schedule schedule;
int compathash = 0;
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/verify_checksum.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/verify_checksum.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/verify_checksum.c (working copy)
@@ -32,7 +32,7 @@
krb5_keyusage usage, const krb5_data *data,
const krb5_checksum *cksum, krb5_boolean *valid)
{
- int i;
+ unsigned int i;
size_t hashsize;
krb5_error_code ret;
krb5_data indata;
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/valid_cksumtype.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/valid_cksumtype.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/valid_cksumtype.c (working copy)
@@ -30,7 +30,7 @@
krb5_boolean KRB5_CALLCONV
krb5_c_valid_cksumtype(krb5_cksumtype ctype)
{
- int i;
+ unsigned int i;
for (i=0; i<krb5_cksumtypes_length; i++) {
if (krb5_cksumtypes_list[i].ctype == ctype)
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/des/weak_key.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/des/weak_key.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/des/weak_key.c (working copy)
@@ -73,7 +73,7 @@
int
mit_des_is_weak_key(mit_des_cblock key)
{
- int i;
+ unsigned int i;
const mit_des_cblock *weak_p = weak;
for (i = 0; i < (sizeof(weak)/sizeof(mit_des_cblock)); i++) {
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/des/string2key.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/des/string2key.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/des/string2key.c (working copy)
@@ -40,7 +40,7 @@
krb5_ui_4 ui[4];
mit_des_cblock cb;
} temp;
- int i;
+ unsigned int i;
krb5_ui_4 x, y, z;
unsigned char *p;
des_key_schedule sched;
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/des/f_parity.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/des/f_parity.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/des/f_parity.c (working copy)
@@ -23,7 +23,7 @@
void
mit_des_fixup_key_parity(mit_des_cblock key)
{
- int i;
+ unsigned int i;
for (i=0; i<sizeof(mit_des_cblock); i++)
{
key[i] &= 0xfe;
@@ -41,7 +41,7 @@
int
mit_des_check_key_parity(mit_des_cblock key)
{
- int i;
+ unsigned int i;
for (i=0; i<sizeof(mit_des_cblock); i++)
{
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/hash_provider/hash_crc32.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/hash_provider/hash_crc32.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/hash_provider/hash_crc32.c (working copy)
@@ -33,7 +33,7 @@
krb5_data *output)
{
unsigned long c, cn;
- int i;
+ unsigned int i;
if (output->length != CRC32_CKSUM_LENGTH)
return(KRB5_CRYPTO_INTERNAL);
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/hash_provider/hash_sha1.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/hash_provider/hash_sha1.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/hash_provider/hash_sha1.c (working copy)
@@ -33,7 +33,7 @@
krb5_data *output)
{
SHS_INFO ctx;
- int i;
+ unsigned int i;
if (output->length != SHS_DIGESTSIZE)
return(KRB5_CRYPTO_INTERNAL);
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/hash_provider/hash_md4.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/hash_provider/hash_md4.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/hash_provider/hash_md4.c (working copy)
@@ -33,7 +33,7 @@
krb5_data *output)
{
krb5_MD4_CTX ctx;
- int i;
+ unsigned int i;
if (output->length != RSA_MD4_CKSUM_LENGTH)
return(KRB5_CRYPTO_INTERNAL);
Index: KerberosFramework/Kerberos5/Sources/lib/crypto/hash_provider/hash_md5.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/crypto/hash_provider/hash_md5.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/crypto/hash_provider/hash_md5.c (working copy)
@@ -33,7 +33,7 @@
krb5_data *output)
{
krb5_MD5_CTX ctx;
- int i;
+ unsigned int i;
if (output->length != RSA_MD5_CKSUM_LENGTH)
return(KRB5_CRYPTO_INTERNAL);
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/copy_ccache.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/copy_ccache.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/copy_ccache.c (working copy)
@@ -6,7 +6,7 @@
gss_cred_id_t cred_handle;
krb5_ccache out_ccache;
{
- OM_uint32 stat;
+ OM_uint32 major_status;
krb5_gss_cred_id_t k5creds;
krb5_cc_cursor cursor;
krb5_creds creds;
@@ -14,9 +14,9 @@
krb5_context context;
/* validate the cred handle */
- stat = krb5_gss_validate_cred(minor_status, cred_handle);
- if (stat)
- return(stat);
+ major_status = krb5_gss_validate_cred(minor_status, cred_handle);
+ if (major_status)
+ return(major_status);
k5creds = (krb5_gss_cred_id_t) cred_handle;
code = k5_mutex_lock(&k5creds->lock);
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/init_sec_context.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/init_sec_context.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/init_sec_context.c (working copy)
@@ -359,7 +359,7 @@
krb5_context context)
{
krb5_error_code code;
- int i;
+ unsigned int i;
krb5int_access kaccess;
code = krb5int_accessor (&kaccess, KRB5INT_ACCESS_VERSION);
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/disp_status.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/disp_status.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/disp_status.c (working copy)
@@ -43,10 +43,10 @@
}
#include "error_map.h"
#include <stdio.h>
-char *get_error_message(OM_uint32 minor_code)
+const char *get_error_message(OM_uint32 minor_code)
{
gsserrmap *p = k5_getspecific(K5_KEY_GSS_KRB5_ERROR_MESSAGE);
- char *msg = 0;
+ const char *msg = 0;
#ifdef DEBUG
fprintf(stderr, "%s(%lu, p=%p)", __func__, (unsigned long) minor_code,
(void *) p);
@@ -104,7 +104,7 @@
#endif
return ret;
}
-void save_error_string(OM_uint32 minor_code, char *msg)
+void save_error_string(OM_uint32 minor_code, const char *msg)
{
char *s = strdup(msg);
if (s) {
@@ -128,7 +128,7 @@
}
void krb5_gss_save_error_info(OM_uint32 minor_code, krb5_context ctx)
{
- char *s;
+ const char *s;
#ifdef DEBUG
fprintf(stderr, "%s(%lu, ctx=%p)\n", __func__,
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/import_sec_context.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/import_sec_context.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/import_sec_context.c (working copy)
@@ -60,7 +60,7 @@
krb5_ser_context_init, krb5_ser_auth_context_init,
krb5_ser_ccache_init, krb5_ser_rcache_init, krb5_ser_keytab_init,
};
- int i;
+ unsigned int i;
for (i = 0; i < sizeof(fns)/sizeof(fns[0]); i++)
if ((code = (fns[i])(context)) != 0)
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/util_seed.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/util_seed.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/util_seed.c (working copy)
@@ -35,7 +35,7 @@
{
krb5_error_code code;
krb5_keyblock *tmpkey;
- int i;
+ unsigned int i;
code = krb5_copy_keyblock(context, key, &tmpkey);
if (code)
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/krb5_gss_glue.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/krb5_gss_glue.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/krb5_gss_glue.c (working copy)
@@ -439,9 +439,8 @@
};
#endif
-#if 1
+extern gss_mechanism *krb5_gss_get_mech_configs(void);
#define gssint_get_mech_configs krb5_gss_get_mech_configs
-#endif
gss_mechanism *
gssint_get_mech_configs(void)
@@ -729,7 +728,7 @@
static OM_uint32
k5glue_inquire_context(ctx, minor_status, context_handle, initiator_name, acceptor_name,
lifetime_rec, mech_type, ret_flags,
- locally_initiated, open)
+ locally_initiated, opened)
void *ctx;
OM_uint32 *minor_status;
gss_ctx_id_t context_handle;
@@ -739,12 +738,12 @@
gss_OID *mech_type;
OM_uint32 *ret_flags;
int *locally_initiated;
- int *open;
+ int *opened;
{
return(krb5_gss_inquire_context(minor_status, context_handle,
initiator_name, acceptor_name, lifetime_rec,
mech_type, ret_flags, locally_initiated,
- open));
+ opened));
}
static OM_uint32
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/gssapiP_krb5.h
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/gssapiP_krb5.h (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/gssapiP_krb5.h (working copy)
@@ -691,10 +691,10 @@
/* For error message handling. */
/* Returns a shared string, not a private copy! */
-extern char *
+extern const char *
krb5_gss_get_error_message(OM_uint32 minor_code);
extern void
-krb5_gss_save_error_string(OM_uint32 minor_code, char *msg);
+krb5_gss_save_error_string(OM_uint32 minor_code, const char *msg);
extern void
krb5_gss_save_error_message(OM_uint32 minor_code, const char *format, ...)
#if !defined(__cplusplus) && (__GNUC__ > 2)
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/set_ccache.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/set_ccache.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/set_ccache.c (working copy)
@@ -37,10 +37,10 @@
const char *name;
const char **out_name;
{
- char *old_name = NULL;
+ const char *old_name = NULL;
OM_uint32 err = 0;
OM_uint32 minor = 0;
- char *gss_out_name;
+ const char *gss_out_name;
err = gssint_initialize_library();
if (err) {
@@ -73,7 +73,7 @@
if (err == 0) {
err = minor;
}
- free(gss_out_name);
+ free((char *) gss_out_name);
gss_out_name = NULL;
}
@@ -84,7 +84,7 @@
}
if (old_name != NULL) {
- free (old_name);
+ free ((char *) old_name);
}
*minor_status = err;
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/k5seal.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/k5seal.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/k5seal.c (working copy)
@@ -61,7 +61,7 @@
int signalg,
size_t cksum_size,
int sealalg,
- int encrypt,
+ int do_encrypt,
int toktype,
int bigend,
gss_OID oid)
@@ -85,10 +85,10 @@
krb5_keyusage sign_usage = KG_USAGE_SIGN;
- assert((!encrypt) || (toktype == KG_TOK_SEAL_MSG));
+ assert((!do_encrypt) || (toktype == KG_TOK_SEAL_MSG));
/* create the token buffer */
/* Do we need confounder? */
- if (encrypt || (!bigend && (toktype == KG_TOK_SEAL_MSG)))
+ if (do_encrypt || (!bigend && (toktype == KG_TOK_SEAL_MSG)))
conflen = kg_confounder_size(context, enc);
else conflen = 0;
@@ -124,7 +124,7 @@
ptr[1] = (signalg >> 8) & 0xff;
/* 2..3 SEAL_ALG or Filler */
- if ((toktype == KG_TOK_SEAL_MSG) && encrypt) {
+ if ((toktype == KG_TOK_SEAL_MSG) && do_encrypt) {
ptr[2] = sealalg & 0xff;
ptr[3] = (sealalg >> 8) & 0xff;
} else {
@@ -252,7 +252,7 @@
return(code);
}
- if (encrypt) {
+ if (do_encrypt) {
switch(sealalg) {
case SEAL_ALG_MICROSOFT_RC4:
{
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/acquire_cred.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/acquire_cred.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/acquire_cred.c (working copy)
@@ -179,7 +179,7 @@
if ((code = krb5_kt_get_entry(context, kt, princ, 0, 0, &entry))) {
(void) krb5_kt_close(context, kt);
if (code == KRB5_KT_NOTFOUND) {
- char *errstr = krb5_get_error_message(context, code);
+ const char *errstr = krb5_get_error_message(context, code);
krb5_set_error_message(context, KG_KEYTAB_NOMATCH, "%s", errstr);
krb5_free_error_message(context, errstr);
*minor_status = KG_KEYTAB_NOMATCH;
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/set_allowable_enctypes.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/set_allowable_enctypes.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/set_allowable_enctypes.c (working copy)
@@ -64,7 +64,7 @@
OM_uint32 num_ktypes,
krb5_enctype *ktypes)
{
- int i;
+ unsigned int i;
krb5_enctype * new_ktypes;
OM_uint32 major_status;
krb5_gss_cred_id_t cred;
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/inq_context.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/inq_context.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/inq_context.c (working copy)
@@ -25,7 +25,7 @@
OM_uint32
krb5_gss_inquire_context(minor_status, context_handle, initiator_name,
acceptor_name, lifetime_rec, mech_type, ret_flags,
- locally_initiated, open)
+ locally_initiated, opened)
OM_uint32 *minor_status;
gss_ctx_id_t context_handle;
gss_name_t *initiator_name;
@@ -34,12 +34,12 @@
gss_OID *mech_type;
OM_uint32 *ret_flags;
int *locally_initiated;
- int *open;
+ int *opened;
{
krb5_context context;
krb5_error_code code;
krb5_gss_ctx_id_rec *ctx;
- krb5_principal init, accept;
+ krb5_principal initiator, acceptor;
krb5_timestamp now;
krb5_deltat lifetime;
@@ -61,8 +61,8 @@
return(GSS_S_NO_CONTEXT);
}
- init = NULL;
- accept = NULL;
+ initiator = NULL;
+ acceptor = NULL;
context = ctx->k5_context;
if ((code = krb5_timeofday(context, &now))) {
@@ -77,13 +77,13 @@
if (initiator_name) {
if ((code = krb5_copy_principal(context,
ctx->initiate?ctx->here:ctx->there,
- &init))) {
+ &initiator))) {
*minor_status = code;
save_error_info(*minor_status, context);
return(GSS_S_FAILURE);
}
- if (! kg_save_name((gss_name_t) init)) {
- krb5_free_principal(context, init);
+ if (! kg_save_name((gss_name_t) initiator)) {
+ krb5_free_principal(context, initiator);
*minor_status = (OM_uint32) G_VALIDATE_FAILED;
return(GSS_S_FAILURE);
}
@@ -92,17 +92,17 @@
if (acceptor_name) {
if ((code = krb5_copy_principal(context,
ctx->initiate?ctx->there:ctx->here,
- &accept))) {
- if (init) krb5_free_principal(context, init);
+ &acceptor))) {
+ if (initiator) krb5_free_principal(context, initiator);
*minor_status = code;
save_error_info(*minor_status, context);
return(GSS_S_FAILURE);
}
- if (! kg_save_name((gss_name_t) accept)) {
- krb5_free_principal(context, accept);
- if (init) {
- kg_delete_name((gss_name_t) init);
- krb5_free_principal(context, init);
+ if (! kg_save_name((gss_name_t) acceptor)) {
+ krb5_free_principal(context, acceptor);
+ if (initiator) {
+ kg_delete_name((gss_name_t) initiator);
+ krb5_free_principal(context, initiator);
}
*minor_status = (OM_uint32) G_VALIDATE_FAILED;
return(GSS_S_FAILURE);
@@ -110,10 +110,10 @@
}
if (initiator_name)
- *initiator_name = (gss_name_t) init;
+ *initiator_name = (gss_name_t) initiator;
if (acceptor_name)
- *acceptor_name = (gss_name_t) accept;
+ *acceptor_name = (gss_name_t) acceptor;
if (lifetime_rec)
*lifetime_rec = lifetime;
@@ -127,8 +127,8 @@
if (locally_initiated)
*locally_initiated = ctx->initiate;
- if (open)
- *open = ctx->established;
+ if (opened)
+ *opened = ctx->established;
*minor_status = 0;
return((lifetime == 0)?GSS_S_CONTEXT_EXPIRED:GSS_S_COMPLETE);
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/accept_sec_context.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/accept_sec_context.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/krb5/accept_sec_context.c (working copy)
@@ -236,7 +236,7 @@
int bigend;
krb5_gss_cred_id_t cred = 0;
krb5_data ap_rep, ap_req;
- int i;
+ unsigned int i;
krb5_error_code code;
krb5_address addr, *paddr;
krb5_authenticator *authdat = 0;
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/gss_libinit.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/gss_libinit.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/gss_libinit.c (working copy)
@@ -3,6 +3,7 @@
#include "gssapi_err_generic.h"
#include "gssapi_err_krb5.h"
#include "gssapiP_krb5.h"
+#include "gssapiP_generic.h"
#include "gss_libinit.h"
#include "k5-platform.h"
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/mechglue/g_initialize.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/mechglue/g_initialize.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/mechglue/g_initialize.c (working copy)
@@ -146,7 +146,7 @@
OM_uint32 *minorStatus;
gss_OID_set *mechSet;
{
- int i, j;
+ unsigned int i, j;
gss_OID curItem;
/* Initialize outputs. */
@@ -232,7 +232,7 @@
static void
free_mechSet(void)
{
- int i;
+ unsigned int i;
if (g_mechSet.count != 0) {
for (i = 0; i < g_mechSet.count; i++)
@@ -415,7 +415,7 @@
/* ensure we have fresh data */
if (k5_mutex_lock(&g_mechListLock) != 0)
- return GSS_S_FAILURE;
+ return NULL;
updateMechList();
aMech = searchMechList(oid);
(void) k5_mutex_unlock(&g_mechListLock);
@@ -579,7 +579,7 @@
return NULL;
if (k5_mutex_lock(&g_mechListLock) != 0)
- return GSS_S_FAILURE;
+ return NULL;
/* check if the mechanism is already loaded */
if ((aMech = searchMechList(oid)) != NULL && aMech->mech) {
(void) k5_mutex_unlock(&g_mechListLock);
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/mechglue/g_acquire_cred.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/mechglue/g_acquire_cred.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/mechglue/g_acquire_cred.c (working copy)
@@ -145,7 +145,7 @@
gss_OID_set mechs;
gss_OID_desc default_OID;
gss_mechanism mech;
- int i;
+ unsigned int i;
gss_union_cred_t creds;
major = val_acq_cred_args(minor_status,
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/mechglue/g_rel_oid_set.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/mechglue/g_rel_oid_set.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/mechglue/g_rel_oid_set.c (working copy)
@@ -39,19 +39,19 @@
OM_uint32 * minor_status;
gss_OID_set * set;
{
- OM_uint32 index;
+ OM_uint32 i;
gss_OID oid;
if (minor_status)
*minor_status = 0;
- if (set ==NULL)
+ if (set == NULL)
return GSS_S_COMPLETE;
if (*set == GSS_C_NULL_OID_SET)
return(GSS_S_COMPLETE);
- for (index=0; index<(*set)->count; index++) {
- oid = &(*set)->elements[index];
+ for (i=0; i<(*set)->count; i++) {
+ oid = &(*set)->elements[i];
free(oid->elements);
}
free((*set)->elements);
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/mechglue/g_inq_context.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/mechglue/g_inq_context.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/mechglue/g_inq_context.c (working copy)
@@ -41,7 +41,7 @@
gss_OID *mech_type,
OM_uint32 *ctx_flags,
int *locally_initiated,
- int *open)
+ int *opened)
{
/* Initialize outputs. */
@@ -73,27 +73,15 @@
/* Last argument new for V2 */
OM_uint32 KRB5_CALLCONV
gss_inquire_context(
- minor_status,
- context_handle,
- src_name,
- targ_name,
- lifetime_rec,
- mech_type,
- ctx_flags,
- locally_initiated,
- open)
-
-OM_uint32 * minor_status;
-gss_ctx_id_t context_handle;
-gss_name_t * src_name;
-gss_name_t * targ_name;
-OM_uint32 * lifetime_rec;
-gss_OID * mech_type;
-OM_uint32 * ctx_flags;
-int * locally_initiated;
-int * open;
-
-
+ OM_uint32 *minor_status,
+ gss_ctx_id_t context_handle,
+ gss_name_t *src_name,
+ gss_name_t *targ_name,
+ OM_uint32 *lifetime_rec,
+ gss_OID *mech_type,
+ OM_uint32 *ctx_flags,
+ int *locally_initiated,
+ int *opened)
{
gss_union_ctx_id_t ctx;
gss_mechanism mech;
@@ -105,7 +93,7 @@
src_name, targ_name,
lifetime_rec,
mech_type, ctx_flags,
- locally_initiated, open);
+ locally_initiated, opened);
if (status != GSS_S_COMPLETE)
return (status);
@@ -132,7 +120,7 @@
NULL,
ctx_flags,
locally_initiated,
- open);
+ opened);
if (status != GSS_S_COMPLETE) {
map_error(minor_status, mech);
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/mechglue/oid_ops.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/mechglue/oid_ops.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/mechglue/oid_ops.c (working copy)
@@ -310,7 +310,7 @@
long numbuf;
long onumbuf;
OM_uint32 nbytes;
- int index;
+ int i;
unsigned char *op;
if (minor_status != NULL)
@@ -412,12 +412,12 @@
}
numbuf = onumbuf;
op += nbytes;
- index = -1;
+ i = -1;
while (numbuf) {
- op[index] = (unsigned char) numbuf & 0x7f;
- if (index != -1)
- op[index] |= 0x80;
- index--;
+ op[i] = (unsigned char) numbuf & 0x7f;
+ if (i != -1)
+ op[i] |= 0x80;
+ i--;
numbuf >>= 7;
}
while (isdigit(*bp))
@@ -466,7 +466,7 @@
gss_OID_set_desc *copy;
OM_uint32 minor = 0;
OM_uint32 major = GSS_S_COMPLETE;
- OM_uint32 index;
+ OM_uint32 i;
if (minor_status != NULL)
*minor_status = 0;
@@ -492,9 +492,9 @@
}
copy->count = oidset->count;
- for (index = 0; index < copy->count; index++) {
- gss_OID_desc *out = ©->elements[index];
- gss_OID_desc *in = &oidset->elements[index];
+ for (i = 0; i < copy->count; i++) {
+ gss_OID_desc *out = ©->elements[i];
+ gss_OID_desc *in = &oidset->elements[i];
if ((out->elements = (void *) malloc(in->length)) == NULL) {
major = GSS_S_FAILURE;
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/spnego/gssapiP_spnego.h
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/spnego/gssapiP_spnego.h (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/spnego/gssapiP_spnego.h (working copy)
@@ -307,7 +307,7 @@
gss_OID *mech_type,
OM_uint32 *ctx_flags,
int *locally_initiated,
- int *open
+ int *opened
);
OM_uint32 spnego_gss_wrap_size_limit
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/spnego/spnego_mech.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/spnego/spnego_mech.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/spnego/spnego_mech.c (working copy)
@@ -205,9 +205,8 @@
&spnego_mechanism, NULL
};
-#if 1
+extern gss_mechanism *spnego_gss_get_mech_configs(void);
#define gssint_get_mech_configs spnego_gss_get_mech_configs
-#endif
gss_mechanism *
gssint_get_mech_configs(void)
@@ -1580,7 +1579,7 @@
gss_OID *mech_type,
OM_uint32 *ctx_flags,
int *locally_initiated,
- int *open)
+ int *opened)
{
OM_uint32 ret = GSS_S_COMPLETE;
@@ -1592,7 +1591,7 @@
mech_type,
ctx_flags,
locally_initiated,
- open);
+ opened);
return (ret);
}
@@ -1696,35 +1695,35 @@
gss_name_t name, gss_cred_usage_t usage,
gss_cred_id_t *creds, gss_OID_set *rmechs)
{
- int i;
+ unsigned int i;
int found = 0;
- OM_uint32 stat = GSS_S_COMPLETE, tmpmin;
+ OM_uint32 major_status = GSS_S_COMPLETE, tmpmin;
gss_OID_set mechs, goodmechs;
- stat = gss_indicate_mechs(minor_status, &mechs);
+ major_status = gss_indicate_mechs(minor_status, &mechs);
- if (stat != GSS_S_COMPLETE) {
- return (stat);
+ if (major_status != GSS_S_COMPLETE) {
+ return (major_status);
}
- stat = gss_create_empty_oid_set(minor_status, rmechs);
+ major_status = gss_create_empty_oid_set(minor_status, rmechs);
- if (stat != GSS_S_COMPLETE) {
+ if (major_status != GSS_S_COMPLETE) {
(void) gss_release_oid_set(minor_status, &mechs);
- return (stat);
+ return (major_status);
}
- for (i = 0; i < mechs->count && stat == GSS_S_COMPLETE; i++) {
+ for (i = 0; i < mechs->count && major_status == GSS_S_COMPLETE; i++) {
if ((mechs->elements[i].length
!= spnego_mechanism.mech_type.length) ||
memcmp(mechs->elements[i].elements,
spnego_mechanism.mech_type.elements,
spnego_mechanism.mech_type.length)) {
- stat = gss_add_oid_set_member(minor_status,
- &mechs->elements[i],
- rmechs);
- if (stat == GSS_S_COMPLETE)
+ major_status = gss_add_oid_set_member(minor_status,
+ &mechs->elements[i],
+ rmechs);
+ if (major_status == GSS_S_COMPLETE)
found++;
}
}
@@ -1734,17 +1733,18 @@
* trim the list of mechanisms down to only those
* for which the creds are valid.
*/
- if (found > 0 && stat == GSS_S_COMPLETE && creds != NULL) {
- stat = gss_acquire_cred(minor_status,
- name, GSS_C_INDEFINITE, *rmechs, usage, creds,
- &goodmechs, NULL);
+ if (found > 0 && major_status == GSS_S_COMPLETE && creds != NULL) {
+ major_status = gss_acquire_cred(minor_status,
+ name, GSS_C_INDEFINITE,
+ *rmechs, usage, creds,
+ &goodmechs, NULL);
/*
* Drop the old list in favor of the new
* "trimmed" list.
*/
(void) gss_release_oid_set(&tmpmin, rmechs);
- if (stat == GSS_S_COMPLETE) {
+ if (major_status == GSS_S_COMPLETE) {
(void) gssint_copy_oid_set(&tmpmin,
goodmechs, rmechs);
(void) gss_release_oid_set(&tmpmin, &goodmechs);
@@ -1752,14 +1752,14 @@
}
(void) gss_release_oid_set(&tmpmin, &mechs);
- if (found == 0 || stat != GSS_S_COMPLETE) {
+ if (found == 0 || major_status != GSS_S_COMPLETE) {
*minor_status = ERR_SPNEGO_NO_MECHS_AVAILABLE;
map_errcode(minor_status);
- if (stat == GSS_S_COMPLETE)
- stat = GSS_S_FAILURE;
+ if (major_status == GSS_S_COMPLETE)
+ major_status = GSS_S_FAILURE;
}
- return (stat);
+ return (major_status);
}
/* following are token creation and reading routines */
@@ -1939,7 +1939,7 @@
put_mech_set(gss_OID_set mechSet, gss_buffer_t buf)
{
unsigned char *ptr;
- int i;
+ unsigned int i;
unsigned int tlen, ilen;
tlen = ilen = 0;
@@ -2236,7 +2236,7 @@
gss_OID returned_mech;
OM_uint32 status;
int present;
- int i;
+ unsigned int i;
for (i = 0; i < mechset->count; i++) {
gss_test_oid_set_member(minor_status, &mechset->elements[i],
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/generic/util_buffer.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/generic/util_buffer.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/generic/util_buffer.c (working copy)
@@ -31,9 +31,7 @@
make sure that buffer is consistent (release'able) when this
function exits, no matter what the exit value */
-int g_make_string_buffer(str, buffer)
- const char *str;
- gss_buffer_t buffer;
+int g_make_string_buffer(const char *str, gss_buffer_t buffer)
{
buffer->length = strlen(str);
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/generic/gssapiP_generic.h
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/generic/gssapiP_generic.h (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/generic/gssapiP_generic.h (working copy)
@@ -255,6 +255,8 @@
gss_OID * /* oid */
);
+int gssint_mecherrmap_init(void);
+void gssint_mecherrmap_destroy(void);
OM_uint32 gssint_mecherrmap_map(OM_uint32 minor, const gss_OID_desc *oid);
int gssint_mecherrmap_get(OM_uint32 minor, gss_OID mech_oid,
OM_uint32 *mech_minor);
Index: KerberosFramework/Kerberos5/Sources/lib/gssapi/generic/util_errmap.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/gssapi/generic/util_errmap.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/gssapi/generic/util_errmap.c (working copy)
@@ -102,7 +102,7 @@
{ "{ 1 2 840 48018 1 2 2 }", "krb5-microsoft" },
{ "{ 1 3 6 1 5 5 2 }", "spnego" },
};
- int i;
+ unsigned int i;
fprintf(f, "%lu@", (unsigned long) value.code);
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/asn.1/asn1buf.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/asn.1/asn1buf.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/asn.1/asn1buf.c (working copy)
@@ -167,7 +167,7 @@
asn1_error_code asn1buf_insert_octetstring(asn1buf *buf, const unsigned int len, const krb5_octet *s)
{
asn1_error_code retval;
- int length;
+ unsigned int length;
retval = asn1buf_ensure_space(buf,len);
if(retval) return retval;
@@ -179,7 +179,7 @@
asn1_error_code asn1buf_insert_charstring(asn1buf *buf, const unsigned int len, const char *s)
{
asn1_error_code retval;
- int length;
+ unsigned int length;
retval = asn1buf_ensure_space(buf,len);
if(retval) return retval;
@@ -198,7 +198,7 @@
asn1_error_code asn1buf_remove_octetstring(asn1buf *buf, const unsigned int len, asn1_octet **s)
{
- int i;
+ unsigned int i;
if (len > buf->bound + 1 - buf->next) return ASN1_OVERRUN;
if (len == 0) {
@@ -216,7 +216,7 @@
asn1_error_code asn1buf_remove_charstring(asn1buf *buf, const unsigned int len, char **s)
{
- int i;
+ unsigned int i;
if (len > buf->bound + 1 - buf->next) return ASN1_OVERRUN;
if (len == 0) {
@@ -247,7 +247,7 @@
asn1_error_code asn12krb5_buf(const asn1buf *buf, krb5_data **code)
{
- int i;
+ unsigned int i;
*code = (krb5_data*)calloc(1,sizeof(krb5_data));
if(*code == NULL) return ENOMEM;
(*code)->magic = KV5M_DATA;
@@ -284,7 +284,7 @@
strcpy(*s,"<EMPTY>");
}else{
unsigned int length = asn1buf_len(buf);
- int i;
+ unsigned int i;
*s = calloc(length+1, sizeof(char));
if(*s == NULL) return ENOMEM;
@@ -338,7 +338,7 @@
}
#undef asn1buf_free
-int asn1buf_free(const asn1buf *buf)
+unsigned int asn1buf_free(const asn1buf *buf)
{
if(buf == NULL || buf->base == NULL) return 0;
else return buf->bound - buf->next + 1;
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/asn.1/ldap_key_seq.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/asn.1/ldap_key_seq.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/asn.1/ldap_key_seq.c (working copy)
@@ -325,7 +325,6 @@
asn1_get_tag_2(&subbuf, &t);
/* Salt */
if (t.tagnum == 0) {
- int buflen;
asn1buf slt;
unsigned long keytype;
int keylen;
@@ -353,7 +352,6 @@
/* Key */
{
- int buflen;
asn1buf kbuf;
long lval;
int ival;
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/asn.1/asn1buf.h
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/asn.1/asn1buf.h (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/asn.1/asn1buf.h (working copy)
@@ -22,14 +22,14 @@
? 0 \
: ((buf)->bound - (buf)->base + 1))
-int asn1buf_free
+unsigned int asn1buf_free
(const asn1buf *buf);
/* requires *buf is allocated
effects Returns the number of unused, allocated octets in *buf. */
#define asn1buf_free(buf) \
(((buf) == NULL || (buf)->base == NULL) \
- ? 0 \
- : ((buf)->bound - (buf)->next + 1))
+ ? 0U \
+ : (unsigned int)((buf)->bound - (buf)->next + 1))
asn1_error_code asn1buf_ensure_space
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/asn.1/asn1_decode.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/asn.1/asn1_decode.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/asn.1/asn1_decode.c (working copy)
@@ -25,6 +25,7 @@
*/
/* ASN.1 primitive decoders */
+#include "k5-int.h" /* for krb5int_gmt_mktime */
#include "asn1_decode.h"
#include "asn1_get.h"
#include <stdio.h>
@@ -55,14 +56,12 @@
#define cleanup()\
return 0
-extern time_t krb5int_gmt_mktime (struct tm *);
-
asn1_error_code asn1_decode_integer(asn1buf *buf, long int *val)
{
setup();
asn1_octet o;
long n = 0; /* initialize to keep gcc happy */
- int i;
+ unsigned int i;
tag(ASN1_INTEGER);
@@ -87,7 +86,7 @@
setup();
asn1_octet o;
unsigned long n;
- int i;
+ unsigned int i;
tag(ASN1_INTEGER);
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/asn.1/asn1_k_decode.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/asn.1/asn1_k_decode.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/asn.1/asn1_k_decode.c (working copy)
@@ -502,7 +502,7 @@
asn1_error_code retval;
asn1_octet unused, o;
taginfo t;
- int i;
+ unsigned int i;
krb5_flags f=0;
unsigned int length;
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/os/localaddr.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/os/localaddr.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/os/localaddr.c (working copy)
@@ -1335,6 +1335,9 @@
}
krb5_error_code
+krb5int_local_addresses(krb5_context context, krb5_address ***addr);
+
+krb5_error_code
krb5int_local_addresses(krb5_context context, krb5_address ***addr)
{
return get_localaddrs(context, addr, 0);
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/os/gen_rname.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/os/gen_rname.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/os/gen_rname.c (working copy)
@@ -35,7 +35,7 @@
krb5_gen_replay_name(krb5_context context, const krb5_address *address, const char *uniq, char **string)
{
char * tmp;
- int i;
+ unsigned int i;
unsigned int len;
len = strlen(uniq) + (address->length * 2) + 1;
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/os/sendto_kdc.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/os/sendto_kdc.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/os/sendto_kdc.c (working copy)
@@ -1087,7 +1087,7 @@
e = 0;
while (selstate->nfds > 0) {
- int i;
+ unsigned int i;
e = krb5int_cm_call_select(selstate, seltemp, &selret);
if (e == EINTR)
@@ -1102,7 +1102,7 @@
return 0;
/* Got something on a socket, process it. */
- for (i = 0; i <= selstate->max && selret > 0 && i < n_conns; i++) {
+ for (i = 0; i <= (unsigned int)selstate->max && selret > 0 && i < n_conns; i++) {
int ssflags;
if (conns[i].fd == INVALID_SOCKET)
@@ -1185,7 +1185,8 @@
int (*msg_handler)(krb5_context, const krb5_data *, void *),
void *msg_handler_data)
{
- int i, pass;
+ unsigned int i;
+ int pass;
int delay_this_pass = 2;
krb5_error_code retval;
struct conn_state *conns;
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/os/changepw.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/os/changepw.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/os/changepw.c (working copy)
@@ -50,6 +50,11 @@
krb5_data ap_req;
};
+krb5_error_code KRB5_CALLCONV
+krb5_change_set_password(krb5_context context, krb5_creds *creds, char *newpw,
+ krb5_principal set_password_for,
+ int *result_code, krb5_data *result_code_string,
+ krb5_data *result_string);
/*
* Wrapper function for the two backends
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/rcache/rc_io.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/rcache/rc_io.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/rcache/rc_io.c (working copy)
@@ -442,7 +442,7 @@
strerror(errno));
return KRB5_RC_IO_UNKNOWN;
}
- if (count != num)
+ if (count < 0 || (unsigned int)count != num)
return KRB5_RC_IO_EOF;
return 0;
}
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/ccache/ccdefault.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/ccache/ccdefault.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/ccache/ccdefault.c (working copy)
@@ -90,7 +90,7 @@
/* This function tries to get tickets and put them in the specified
cache, however, if the cache does not exist, it may choose to put
them elsewhere (ie: the system default) so we set that here */
- char * ccdefname = krb5_cc_default_name (context);
+ const char * ccdefname = krb5_cc_default_name (context);
if (!ccdefname || strcmp (ccdefname, outCacheName) != 0) {
krb5_cc_set_default_name (context, outCacheName);
}
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/krb/ser_ctx.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/krb/ser_ctx.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/krb/ser_ctx.c (working copy)
@@ -170,7 +170,7 @@
size_t required;
krb5_octet *bp;
size_t remain;
- int i;
+ unsigned int i;
required = 0;
bp = *buffer;
@@ -333,7 +333,7 @@
krb5_int32 ibuf;
krb5_octet *bp;
size_t remain;
- int i;
+ unsigned int i;
bp = *buffer;
remain = *lenremain;
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/krb/pkinit_apple_cert_store.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/krb/pkinit_apple_cert_store.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/krb/pkinit_apple_cert_store.c (working copy)
@@ -261,6 +261,7 @@
SecIdentityRef idRef = NULL;
OSStatus ortn;
CFDictionaryRef theDict = NULL;
+ CFStringRef cfPrinc = NULL;
krb5_error_code ourRtn = 0;
if(principal == NULL) {
@@ -274,8 +275,8 @@
}
/* Entry in the dictionary for specified principal? */
- CFStringRef cfPrinc = CFStringCreateWithCString(NULL, principal,
- kCFStringEncodingASCII);
+ cfPrinc = CFStringCreateWithCString(NULL, principal,
+ kCFStringEncodingASCII);
issuerSerial = (CFDataRef)CFDictionaryGetValue(theDict, cfPrinc);
CFRelease(cfPrinc);
if(issuerSerial == NULL) {
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/krb/pkinit_apple_utils.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/krb/pkinit_apple_utils.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/krb/pkinit_apple_utils.c (working copy)
@@ -158,6 +158,7 @@
krb5_ui_4 len;
krb5_int32 rtn = 0;
krb5_ui_4 dex;
+ uint8 *cp = NULL;
if((cdata->Length == 0) || (cdata->Data == NULL)) {
*i = 0;
@@ -168,7 +169,7 @@
return ASN1_BAD_LENGTH;
}
- uint8 *cp = cdata->Data;
+ cp = cdata->Data;
for(dex=0; dex<len; dex++) {
rtn = (rtn << 8) | *cp++;
}
@@ -291,6 +292,7 @@
krb5_timestamp kts,
char **str) /* mallocd and RETURNED */
{
+ char *outStr = NULL;
time_t gmt_time = kts;
struct tm *utc = gmtime(&gmt_time);
if (utc == NULL ||
@@ -299,7 +301,7 @@
utc->tm_min > 59 || utc->tm_sec > 59) {
return ASN1_BAD_GMTIME;
}
- char *outStr = (char *)malloc(16);
+ outStr = (char *)malloc(16);
if(outStr == NULL) {
return ENOMEM;
}
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/krb/gc_frm_kdc.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/krb/gc_frm_kdc.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/krb/gc_frm_kdc.c (working copy)
@@ -788,7 +788,7 @@
krb5_creds tgtq, cc_tgt, *tgtptr, *referral_tgts[KRB5_REFERRAL_MAXHOPS];
krb5_boolean old_use_conf_ktypes;
char **hrealms;
- int referral_count, i;
+ unsigned int referral_count, i;
/*
* Set up client and server pointers. Make a fresh and modifyable
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/krb/srv_rcache.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/krb/srv_rcache.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/krb/srv_rcache.c (working copy)
@@ -41,7 +41,7 @@
char *cachename = 0, *cachetype;
char tmp[4];
krb5_error_code retval;
- int p, i;
+ unsigned int p, i;
unsigned int len;
#ifdef HAVE_GETEUID
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/krb/preauth2.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/krb/preauth2.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/krb/preauth2.c (working copy)
@@ -1773,7 +1773,8 @@
krb5_preauth_client_rock *get_data_rock,
krb5_gic_opt_ext *opte)
{
- int h, i, j, out_pa_list_size;
+ unsigned int h;
+ int i, j, out_pa_list_size;
int seen_etype_info2 = 0;
krb5_pa_data *out_pa = NULL, **out_pa_list = NULL;
krb5_data scratch;
Index: KerberosFramework/Kerberos5/Sources/lib/krb5/krb/str_conv.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/lib/krb5/krb/str_conv.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/lib/krb5/krb/str_conv.c (working copy)
@@ -251,7 +251,7 @@
"%x %X", /* locale-dependent short format */
"%d/%m/%Y %R" /* dd/mm/yyyy hh:mm */
};
- static const int sftime_format_table_nents =
+ static const unsigned int sftime_format_table_nents =
sizeof(sftime_format_table)/sizeof(sftime_format_table[0]);
#ifdef HAVE_LOCALTIME_R
Index: KerberosFramework/Kerberos5/Sources/util/support/threads.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/util/support/threads.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/util/support/threads.c (working copy)
@@ -171,6 +171,7 @@
static struct tsd_block tsd_if_single;
# define GET_NO_PTHREAD_TSD() (&tsd_if_single)
#else
+int krb5int_pthread_loaded (void);
int krb5int_pthread_loaded (void)
{
return 1;
@@ -252,7 +253,7 @@
return t->values[keynum];
}
-int k5_setspecific (k5_key_t keynum, void *value)
+int k5_setspecific (k5_key_t keynum, const void *value)
{
struct tsd_block *t;
int err;
@@ -614,6 +615,8 @@
}
#undef krb5int_mutex_report_stats
void KRB5_CALLCONV
+krb5int_mutex_report_stats(k5_mutex_t *m);
+void KRB5_CALLCONV
krb5int_mutex_report_stats(k5_mutex_t *m)
{
}
Index: KerberosFramework/Kerberos5/Sources/util/support/gmt_mktime.c
===================================================================
--- KerberosFramework/Kerberos5/Sources/util/support/gmt_mktime.c (revision 20689)
+++ KerberosFramework/Kerberos5/Sources/util/support/gmt_mktime.c (working copy)
@@ -2,6 +2,7 @@
#include <stdio.h>
#include "autoconf.h"
+#include "k5-int.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
More information about the krb5-bugs
mailing list