From a0f4af772160450393bfb0080d72234b3ddaabed Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Tue, 4 Oct 1994 21:42:39 +0000 Subject: [PATCH] Add magic numbers to encryption strctures Make first argument to keytab.resolve be a const char *. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4446 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/krb5/ChangeLog | 8 +++++++- src/include/krb5/encryption.h | 6 +++--- src/include/krb5/keytab.h | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/include/krb5/ChangeLog b/src/include/krb5/ChangeLog index 1567c36d8..90bb595b3 100644 --- a/src/include/krb5/ChangeLog +++ b/src/include/krb5/ChangeLog @@ -1,6 +1,12 @@ Tue Oct 4 14:51:32 1994 Theodore Y. Ts'o (tytso@dcl) -* encryption.h: Add magic number to encryption structures. + * encryption.h: Cast various potential shorts to ints. This is + not quite right either, but the whole encryption interface + needs to be fixed. + + * keytab.h (krb5_kt_ops.resolv): Resolve's first argument is a const. + + * encryption.h: Add magic number to encryption structures. Mon Oct 3 18:45:55 1994 Theodore Y. Ts'o (tytso@dcl) diff --git a/src/include/krb5/encryption.h b/src/include/krb5/encryption.h index 5305870db..8df3b171e 100644 --- a/src/include/krb5/encryption.h +++ b/src/include/krb5/encryption.h @@ -165,11 +165,11 @@ extern int krb5_max_keytype; /* max entry in array */ extern krb5_checksum_entry *krb5_cksumarray[]; extern int krb5_max_cksum; /* max entry in array */ -#define valid_etype(etype) ((etype <= krb5_max_cryptosystem) && (etype > 0) && krb5_csarray[etype]) +#define valid_etype(etype) ((((int) etype) <= krb5_max_cryptosystem) && (etype > 0) && krb5_csarray[etype]) -#define valid_keytype(ktype) ((ktype <= krb5_max_keytype) && (ktype > 0) && krb5_keytype_array[ktype]) +#define valid_keytype(ktype) ((((int) ktype) <= krb5_max_keytype) && (ktype > 0) && krb5_keytype_array[ktype]) -#define valid_cksumtype(cktype) ((cktype <= krb5_max_cksum) && (cktype > 0) && krb5_cksumarray[cktype]) +#define valid_cksumtype(cktype) ((((int) cktype) <= krb5_max_cksum) && (cktype > 0) && krb5_cksumarray[cktype]) #define is_coll_proof_cksum(cktype) (krb5_cksumarray[cktype]->is_collision_proof) #define is_keyed_cksum(cktype) (krb5_cksumarray[cktype]->uses_key) diff --git a/src/include/krb5/keytab.h b/src/include/krb5/keytab.h index dd554628a..fb7a85120 100644 --- a/src/include/krb5/keytab.h +++ b/src/include/krb5/keytab.h @@ -57,7 +57,7 @@ typedef struct _krb5_kt_ops { krb5_magic magic; char *prefix; /* routines always present */ - krb5_error_code (*resolve) NPROTOTYPE((char *, + krb5_error_code (*resolve) NPROTOTYPE((const char *, krb5_keytab *)); krb5_error_code (*get_name) NPROTOTYPE((krb5_keytab, char *, -- 2.26.2