#include <krb5/copyright.h>
-#ifndef __KRB5_ENCRYPTION__
-#define __KRB5_ENCRYPTION__
+#ifndef KRB5_ENCRYPTION__
+#define KRB5_ENCRYPTION__
typedef struct _krb5_keyblock {
krb5_keytype keytype;
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 {
#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__ */