From: John Kohl Date: Mon, 26 Mar 1990 16:52:49 +0000 (+0000) Subject: add proto_keytype to entry X-Git-Tag: krb5-1.0-alpha2~967 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1faaee27ca842a8bbd7305e1bce0c9fdae715ed1;p=krb5.git add proto_keytype to entry add krb5_keytype_array, valid_keytype fix names for include blockers git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@421 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/krb5/encryption.h b/src/include/krb5/encryption.h index 9128bdc8d..6cf3e9807 100644 --- a/src/include/krb5/encryption.h +++ b/src/include/krb5/encryption.h @@ -13,8 +13,8 @@ #include -#ifndef __KRB5_ENCRYPTION__ -#define __KRB5_ENCRYPTION__ +#ifndef KRB5_ENCRYPTION__ +#define KRB5_ENCRYPTION__ typedef struct _krb5_keyblock { krb5_keytype keytype; @@ -60,7 +60,11 @@ typedef struct _krb5_cryptosystem_entry { int pad_minimum; /* needed for cksum size computation */ int keysize; krb5_enctype proto_enctype; /* encryption type, - (assigned protocol number) */ + (assigned protocol number AND + table index) */ + krb5_keytype proto_keytype; /* key type, + (assigned protocol number AND + table index) */ } krb5_cryptosystem_entry; typedef struct _krb5_cs_table_entry { @@ -109,15 +113,25 @@ typedef struct _krb5_checksum_entry { #define krb5_encrypt_size(length, crypto) \ krb5_roundup((length)+(crypto)->pad_minimum, (crypto)->block_length) +/* This array is indexed by encryption type */ extern krb5_cs_table_entry *krb5_csarray[]; extern int krb5_max_cryptosystem; /* max entry in array */ +/* This array is indexed by key type, and has (should have) pointers to + the same entries as krb5_csarray */ +/* XXX what if a given keytype works for several etypes? */ +extern krb5_cs_table_entry *krb5_keytype_array[]; +extern int krb5_max_keytype; /* max entry in array */ + +/* This array is indexed by checksum type */ 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_keytype(ktype) ((ktype <= krb5_max_keytype) && (ktype > 0) && krb5_keytype_array[ktype]) + #define valid_cksumtype(cktype) ((cktype <= krb5_max_cksum) && (cktype > 0) && krb5_cksumarray[cktype]) -#endif /* __KRB5_ENCRYPTION__ */ +#endif /* KRB5_ENCRYPTION__ */