From: Paul Park Date: Mon, 7 Aug 1995 21:43:35 +0000 (+0000) Subject: Handle V4 salttype correctly X-Git-Tag: krb5-1.0-beta6~1384 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5e88991c9fcbbfd0332d1c99a0e18a39ad6a2459;p=krb5.git Handle V4 salttype correctly git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6440 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/v5server/srv_key.c b/src/kadmin/v5server/srv_key.c index eed888f7a..37cdbf573 100644 --- a/src/kadmin/v5server/srv_key.c +++ b/src/kadmin/v5server/srv_key.c @@ -672,8 +672,11 @@ key_string2key_keysalt(ksent, ptr) */ if (!salted) { switch (kdata->key_data_type[1]) { - case KRB5_KDB_SALTTYPE_NORMAL: case KRB5_KDB_SALTTYPE_V4: + salt.length = 0; + salt.data = (char *) NULL; + break; + case KRB5_KDB_SALTTYPE_NORMAL: /* Normal salt */ if (kret = krb5_principal2salt(argp->context, argp->dbentry->princ, @@ -964,14 +967,15 @@ key_encrypt_keys(kcontext, dbentp, nkeysp, inkeys, outkeysp) else break; } + else + salt.data.data = (char *) NULL; + if (kret = krb5_dbekd_encrypt_key_data(kcontext, &master_encblock, &tmpkey, - (salt.data.length) ? - &salt : - (krb5_keysalt *) NULL, + &salt, (int) inkeys[i]. - key_data_kvno, + key_data_kvno, &loser.key_data[i])) break; else