From 130536eee97c529e3f1f1e15339e58130a873b3a Mon Sep 17 00:00:00 2001 From: Mark Eichin Date: Tue, 12 Nov 1996 01:28:24 +0000 Subject: [PATCH] * kdb_cpw.c (add_key_pwd): set length to -1 so krb5_string_to_key handles the AFS3 salttype, but then replace it with the actual length for later processing. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9377 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kdb/ChangeLog | 6 ++++++ src/lib/kdb/kdb_cpw.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog index cdd78eae8..53acac471 100644 --- a/src/lib/kdb/ChangeLog +++ b/src/lib/kdb/ChangeLog @@ -1,3 +1,9 @@ +Mon Nov 11 20:21:02 1996 Mark Eichin + + * kdb_cpw.c (add_key_pwd): set length to -1 so krb5_string_to_key + handles the AFS3 salttype, but then replace it with the actual + length for later processing. + Mon Nov 11 17:03:16 1996 Barry Jaspan * kdb_cpw.c (cleanup_key_data): fix memory leak [krb5-kdc/163] diff --git a/src/lib/kdb/kdb_cpw.c b/src/lib/kdb/kdb_cpw.c index c378ac6f9..87caafc23 100644 --- a/src/lib/kdb/kdb_cpw.c +++ b/src/lib/kdb/kdb_cpw.c @@ -398,7 +398,7 @@ add_key_pwd(context, master_eblock, ks_tuple, ks_tuple_count, passwd, return(retval); key_salt.data = *saltdata; - /* key_salt.data.length = -1; *//*length actually used below...*/ + key_salt.data.length = -1; /*length actually used below...*/ krb5_xfree(saltdata); } break; @@ -415,6 +415,10 @@ add_key_pwd(context, master_eblock, ks_tuple, ks_tuple_count, passwd, return(retval); } + if (key_salt.data.length == -1) + key_salt.data.length = + krb5_princ_realm(context, db_entry->princ)->length; + if (retval = krb5_dbekd_encrypt_key_data(context, master_eblock, &key, (const krb5_keysalt *)&key_salt, kvno, &db_entry->key_data[db_entry->n_key_data-1])) { -- 2.26.2