diff options
| author | Sam Hartman <hartmans@mit.edu> | 2003-05-24 01:03:30 +0000 |
|---|---|---|
| committer | Sam Hartman <hartmans@mit.edu> | 2003-05-24 01:03:30 +0000 |
| commit | 7f7fbec7637a8c1c1ee2f9afd5decf5fda230335 (patch) | |
| tree | c8dff2a4bfcfe08acac31c75bec019eaa56d594d /src/lib/crypto/old | |
| parent | fd14217c0335db3591078911d49d6e5094f2606e (diff) | |
| download | krb5-7f7fbec7637a8c1c1ee2f9afd5decf5fda230335.tar.gz krb5-7f7fbec7637a8c1c1ee2f9afd5decf5fda230335.tar.xz krb5-7f7fbec7637a8c1c1ee2f9afd5decf5fda230335.zip | |
When generating etype_info2 for DES style keys, use s2kparams to
communicate the type if the key has afs3 salt.
If such s2kparams are received by the client, use the afs string2key
function to process the key.
Ticket: 1512
Tags: pullup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15489 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/crypto/old')
| -rw-r--r-- | src/lib/crypto/old/ChangeLog | 6 | ||||
| -rw-r--r-- | src/lib/crypto/old/des_stringtokey.c | 17 |
2 files changed, 21 insertions, 2 deletions
diff --git a/src/lib/crypto/old/ChangeLog b/src/lib/crypto/old/ChangeLog index c23b40371..bab270489 100644 --- a/src/lib/crypto/old/ChangeLog +++ b/src/lib/crypto/old/ChangeLog @@ -1,3 +1,9 @@ +2003-05-23 Sam Hartman <hartmans@mit.edu> + + * des_stringtokey.c (krb5int_des_string_to_key): If param has one + byte, treat it as a type. Type 0 is normal, type 1 is AFS + string2key. + 2003-03-04 Ken Raeburn <raeburn@mit.edu> * des_stringtokey.c (krb5int_des_string_to_key): Renamed from diff --git a/src/lib/crypto/old/des_stringtokey.c b/src/lib/crypto/old/des_stringtokey.c index fd3440bda..20f2f053a 100644 --- a/src/lib/crypto/old/des_stringtokey.c +++ b/src/lib/crypto/old/des_stringtokey.c @@ -26,6 +26,7 @@ #include "k5-int.h" #include "old.h" +#include <des_int.h> /* XXX */ extern krb5_error_code mit_des_string_to_key_int @@ -41,7 +42,19 @@ krb5int_des_string_to_key(enc, string, salt, parm, key) const krb5_data *parm; krb5_keyblock *key; { - if (parm != NULL) - return KRB5_ERR_BAD_S2K_PARAMS; + int type; + if (parm ) { + if (parm->length != 1) + return KRB5_ERR_BAD_S2K_PARAMS; + type = parm->data[0]; + } + else type = 0; + switch(type) { + case 0: return(mit_des_string_to_key_int(key, string, salt)); + case 1: + return mit_afs_string_to_key(key, string, salt); + default: + return KRB5_ERR_BAD_S2K_PARAMS; + } } |
