add proto_keytype to entry
authorJohn Kohl <jtkohl@mit.edu>
Mon, 26 Mar 1990 16:52:49 +0000 (16:52 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Mon, 26 Mar 1990 16:52:49 +0000 (16:52 +0000)
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

src/include/krb5/encryption.h

index 9128bdc8df02d40642d62ba08ca86e5f8b21d072..6cf3e980790af68f0933cae13eaf8d3c1d742c41 100644 (file)
@@ -13,8 +13,8 @@
 
 #include <krb5/copyright.h>
 
-#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__ */