+Wed Sep 06 14:20:57 1995 Chris Provenzano (proven@mit.edu)
+
+ * des_int.h, destest.c, init_rkey.c, random_key.c, string2key.c
+ * verify.c : s/keytype/enctype/g, s/KEYTYPE/ENCTYPE/g
+
+Tue Sep 05 22:10:34 1995 Chris Provenzano (proven@mit.edu)
+
+ * destest.c, random_key.c, string2key.c, verify.c : Remove krb5_enctype
+ references, and replace with krb5_keytype where appropriate.
+ * init_rkey.c (mit_des_init_random_key()),
+ * string2key.c (mit_des_string_to_key()) : Allow for any DES keytype.
+
Tue Aug 29 13:29:19 EDT 1995 Paul Park (pjpark@mit.edu)
* process_key.c, finish_key.c - Set and use priv_size in the krb5_
/* string2key.c */
extern krb5_error_code mit_des_string_to_key
- PROTOTYPE(( const krb5_encrypt_block FAR *, const krb5_keytype,
+ PROTOTYPE(( const krb5_encrypt_block FAR *, const krb5_enctype,
krb5_keyblock FAR *, const krb5_data FAR *, const krb5_data FAR *));
/* weak_key.c */
/* do some initialisation */
initialize_krb5_error_table();
- krb5_use_cstype(context, &eblock, ETYPE_DES_CBC_CRC);
+ krb5_use_enctype(context, &eblock, ENCTYPE_DES_CBC_CRC);
keyblock.magic = KV5M_KEYBLOCK;
- keyblock.etype = ETYPE_DES_CBC_CRC;
- keyblock.keytype = KEYTYPE_DES;
+ keyblock.enctype = ENCTYPE_DES_CBC_CRC;
keyblock.length = sizeof (mit_des_cblock);
keyblock.contents = (krb5_octet *)key;
* des_pcbc_encrypt.c - encrypt a string of characters in error propagation mode
*/
#include "des.h"
-#include "des_int.h"
#include "f_tables.h"
/*
krb5_pointer * seed;
{
mit_des_random_key_seed * p_seed;
- if (seedblock->keytype != KEYTYPE_DES)
- return KRB5_BAD_KEYTYPE;
+ if ((seedblock->enctype != ENCTYPE_DES_CBC_CRC) &&
+ (seedblock->enctype != ENCTYPE_DES_CBC_MD4) &&
+ (seedblock->enctype != ENCTYPE_DES_CBC_MD5) &&
+ (seedblock->enctype != ENCTYPE_DES_CBC_RAW))
+ return KRB5_BAD_ENCTYPE;
if ( !(p_seed = (mit_des_random_key_seed *)
malloc(sizeof(mit_des_random_key_seed))) )
return ENOMEM;
return ENOMEM;
}
randkey->magic = KV5M_KEYBLOCK;
- randkey->etype = eblock->crypto_entry->proto_enctype;
randkey->length = sizeof(mit_des_cblock);
- randkey->keytype = KEYTYPE_DES;
+ randkey->enctype = eblock->crypto_entry->proto_enctype;
mit_des_new_random_key(randkey->contents, (mit_des_random_key_seed *) seed);
*keyblock = randkey;
return 0;
/*
converts the string pointed to by "data" into an encryption key
- of type "keytype". *keyblock is filled in with the key info;
+ of type "enctype". *keyblock is filled in with the key info;
in particular, keyblock->contents is to be set to allocated storage.
It is the responsibility of the caller to release this storage
when the generated key no longer needed.
algorithm.
If the particular function called does not know how to make a
- key of type "keytype", an error may be returned.
+ key of type "enctype", an error may be returned.
returns: errors
*/
krb5_error_code
-mit_des_string_to_key (eblock, keytype, keyblock, data, salt)
+mit_des_string_to_key (eblock, enctype, keyblock, data, salt)
const krb5_encrypt_block FAR * eblock;
-const krb5_keytype keytype;
+const krb5_enctype enctype;
krb5_keyblock FAR * keyblock;
const krb5_data FAR * data;
const krb5_data FAR * salt;
#define min(A, B) ((A) < (B) ? (A): (B))
#endif
- if ( keytype != KEYTYPE_DES )
- return (KRB5_PROG_KEYTYPE_NOSUPP);
+ if ((enctype != ENCTYPE_DES_CBC_CRC) && (enctype != ENCTYPE_DES_CBC_MD4) &&
+ (enctype != ENCTYPE_DES_CBC_MD5) && (enctype != ENCTYPE_DES_CBC_RAW))
+ return (KRB5_PROG_ETYPE_NOSUPP);
if ( !(keyblock->contents = (krb5_octet *)malloc(sizeof(mit_des_cblock))) )
return(ENOMEM);
keyblock->magic = KV5M_KEYBLOCK;
- keyblock->etype = eblock->crypto_entry->proto_enctype;
- keyblock->keytype = KEYTYPE_DES;
keyblock->length = sizeof(mit_des_cblock);
+ keyblock->enctype = eblock->crypto_entry->proto_enctype;
key = keyblock->contents;
if (salt)
/* do some initialisation */
initialize_krb5_error_table();
- krb5_use_cstype(context, &eblock, ETYPE_DES_CBC_CRC);
- keyblock.keytype = KEYTYPE_DES;
- keyblock.length = sizeof (mit_des_cblock);
+ krb5_use_enctype(context, &eblock, ENCTYPE_DES_CBC_CRC);
+ keyblock.enctype = ENCTYPE_DES_CBC_CRC;
+ keyblock.length = sizeof(mit_des_cblock);
/* use known input and key */