summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/des/string2key.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/crypto/des/string2key.c')
-rw-r--r--src/lib/crypto/des/string2key.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/crypto/des/string2key.c b/src/lib/crypto/des/string2key.c
index e5cddf02f3..166db5f48e 100644
--- a/src/lib/crypto/des/string2key.c
+++ b/src/lib/crypto/des/string2key.c
@@ -26,7 +26,7 @@
/*
converts the string pointed to by "data" into an encryption key
- of type "enctype". *keyblock is filled in with the key info;
+ of type "keytype". *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.
@@ -35,15 +35,15 @@
algorithm.
If the particular function called does not know how to make a
- key of type "enctype", an error may be returned.
+ key of type "keytype", an error may be returned.
returns: errors
*/
krb5_error_code
-mit_des_string_to_key (eblock, enctype, keyblock, data, salt)
+mit_des_string_to_key (eblock, keytype, keyblock, data, salt)
const krb5_encrypt_block FAR * eblock;
-const krb5_enctype enctype;
+const krb5_keytype keytype;
krb5_keyblock FAR * keyblock;
const krb5_data FAR * data;
const krb5_data FAR * salt;
@@ -65,16 +65,16 @@ const krb5_data FAR * salt;
#define min(A, B) ((A) < (B) ? (A): (B))
#endif
- 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 ( keytype != KEYTYPE_DES )
+ return (KRB5_PROG_KEYTYPE_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)