[1675] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

V5 kinit does not work with loaded V4 db

daemon@ATHENA.MIT.EDU (Richard Basch)
Tue Oct 17 18:04:46 1995

Date: Tue, 17 Oct 1995 18:04:05 -0400
To: krb5-bugs@MIT.EDU
From: "Richard Basch" <basch@lehman.com>


This patch works around the problem that when you load a V4 db into V5,
you can only use the V4 kinit.  With this patch, the V5 kinit now works...


--- 1.1	1995/10/10 09:50:06
+++ src/kdc/main.c	1995/10/17 21:57:28
@@ -370,13 +370,20 @@
 		 * XXX
 		 * Initialize default key/salt list.
 		 */
+		nkslist = 1;
+#ifdef KRB5_KRB4_COMPAT
+		nkslist++;
+#endif
 		if ((kslist = (krb5_key_salt_tuple *)
-		     malloc(sizeof(krb5_key_salt_tuple)))) {
-		    kslist->ks_enctype = ENCTYPE_DES_CBC_CRC;
-		    kslist->ks_salttype = KRB5_KDB_SALTTYPE_NORMAL;
+		     malloc(nkslist * sizeof(krb5_key_salt_tuple)))) {
+		    kslist[i = 0].ks_enctype = ENCTYPE_DES_CBC_CRC;
+		    kslist[0].ks_salttype = KRB5_KDB_SALTTYPE_NORMAL;
+#ifdef KRB5_KRB4_COMPAT
+		    kslist[++i].ks_enctype = ENCTYPE_DES_CBC_CRC;
+		    kslist[i].ks_salttype = KRB5_KDB_SALTTYPE_V4;
+#endif
 		    rdp->realm_kstypes = kslist;
-		    rdp->realm_nkstypes = 1;
-		    nkslist = 1;
+		    rdp->realm_nkstypes = nkslist;
 		}
 		else {
 		    com_err(progname, ENOMEM,

Richard Basch
Lehman Brothers, Inc.           Email: basch@lehman.com
101 Hudson Street 33rd Flr.     Fax:   +1-201-524-5828
Jersey City, NJ  07302          Voice: +1-201-524-5049


home help back first fref pref prev next nref lref last post