svn commit: lorikeet r309 - in trunk/heimdal: kdc lib/hdb

abartlet at samba.org abartlet at samba.org
Fri May 20 11:16:31 GMT 2005


Author: abartlet
Date: 2005-05-20 11:16:31 +0000 (Fri, 20 May 2005)
New Revision: 309

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=309

Log:
I still need to fix up TGS issues, but this ensures we pass back to
the caller the canonacolised realm name.  (That is, the AS_REPpacket
from the server to the client has the servers idea of the correct
REALM, in long form UPPER case, for both client and server
principals).

Andrew Bartlett

Modified:
   trunk/heimdal/kdc/kerberos5.c
   trunk/heimdal/lib/hdb/hdb-ldb.c


Changeset:
Modified: trunk/heimdal/kdc/kerberos5.c
===================================================================
--- trunk/heimdal/kdc/kerberos5.c	2005-05-20 10:03:35 UTC (rev 308)
+++ trunk/heimdal/kdc/kerberos5.c	2005-05-20 11:16:31 UTC (rev 309)
@@ -1003,14 +1003,16 @@
     
     rep.pvno = 5;
     rep.msg_type = krb_as_rep;
-    copy_Realm(&b->realm, &rep.crealm);
+    copy_Realm(&client->principal->realm, &rep.crealm);
     if (f.request_anonymous)
 	make_anonymous_principalname (&rep.cname);
     else
-	copy_PrincipalName(b->cname, &rep.cname);
+	_krb5_principal2principalname(&rep.cname, 
+				      client->principal);
     rep.ticket.tkt_vno = 5;
-    copy_Realm(&b->realm, &rep.ticket.realm);
-    copy_PrincipalName(b->sname, &rep.ticket.sname);
+    copy_Realm(&server->principal->realm, &rep.ticket.realm);
+    _krb5_principal2principalname(&rep.ticket.sname, 
+				  server->principal);
 
     et.flags.initial = 1;
     if(client->flags.forwardable && server->flags.forwardable)
@@ -1044,7 +1046,7 @@
 
     krb5_generate_random_keyblock(context, setype, &et.key);
     copy_PrincipalName(&rep.cname, &et.cname);
-    copy_Realm(&b->realm, &et.crealm);
+    copy_Realm(&rep.crealm, &et.crealm);
     
     {
 	time_t start;

Modified: trunk/heimdal/lib/hdb/hdb-ldb.c
===================================================================
--- trunk/heimdal/lib/hdb/hdb-ldb.c	2005-05-20 10:03:35 UTC (rev 308)
+++ trunk/heimdal/lib/hdb/hdb-ldb.c	2005-05-20 11:16:31 UTC (rev 309)
@@ -271,7 +271,7 @@
 		 * we determine from our records */
 		
 		/* don't leak */
-		free(*krb5_princ_realm(context, principal));
+		free(*krb5_princ_realm(context, ent->principal));
 		
 		/* this has to be with malloc() */
 		strdup_realm = strdup(realm);
@@ -280,7 +280,7 @@
 			krb5_clear_error_string(context);
 			goto out;
 		}
-		krb5_princ_set_realm(context, principal, &strdup_realm);
+		krb5_princ_set_realm(context, ent->principal, &strdup_realm);
 	}
 
 	ent->kvno = ldb_msg_find_int(msg, "msDS-KeyVersionNumber", 0);



More information about the samba-cvs mailing list