Remove unneeded kdcRealm field in PKINIT structure
authorGreg Hudson <ghudson@mit.edu>
Sun, 8 Jan 2012 21:54:29 +0000 (21:54 +0000)
committerGreg Hudson <ghudson@mit.edu>
Sun, 8 Jan 2012 21:54:29 +0000 (21:54 +0000)
krb5_pk_authenticator_draft9 had a kdcRealm field which was set by the
client code but never encoded or decoded.  Remove it.  Eliminating this
field exposed a bug in auth_pack_draft9_optional; fix that.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25624 dc483132-0cff-0310-8789-dd5450dbe970

src/include/k5-int-pkinit.h
src/lib/krb5/asn.1/asn1_k_decode.c
src/lib/krb5/asn.1/asn1_k_encode.c
src/plugins/preauth/pkinit/pkinit_clnt.c
src/tests/asn.1/ktest.c

index b5b0863d7c80e6d07df3b4aaf70ac56a853aa0a7..7fbbc53ee16ebf19bde22d1e136dc92eada346e1 100644 (file)
@@ -47,7 +47,6 @@ typedef struct _krb5_pk_authenticator {
 /* PKAuthenticator draft9 */
 typedef struct _krb5_pk_authenticator_draft9 {
     krb5_principal  kdcName;
-    krb5_data       kdcRealm;
     krb5_int32      cusec;  /* (0..999999) */
     krb5_timestamp  ctime;
     krb5_int32      nonce;  /* (0..4294967295) */
index f25126ebeb6841137c31790b559f49738d78dbc3..b2471004aa42ba36831e5d4be277d624598176d7 100644 (file)
@@ -1370,7 +1370,6 @@ asn1_decode_pk_authenticator_draft9(asn1buf *buf,
 {
     setup();
     val->kdcName = NULL;
-    val->kdcRealm.data = NULL;
     { begin_structure();
         alloc_principal(val->kdcName);
         get_field(val->kdcName, 0, asn1_decode_principal_name);
index a811e7e4cbecac1d30163a36fc4953d52643acc0..f149849a956760af40f35eabd67976ae2da81984 100644 (file)
@@ -1428,7 +1428,7 @@ static unsigned int
 auth_pack_draft9_optional(const void *p)
 {
     unsigned int optional = 0;
-    const krb5_auth_pack *val = p;
+    const krb5_auth_pack_draft9 *val = p;
     if (val->clientPublicValue != NULL)
         optional |= (1u << 1);
     return optional;
index cf406fd0caf8bc11033e7aff01822335679a95a2..609cc9b009c7bb0732dd5cb2f10702f8315a6c8e 100644 (file)
@@ -260,9 +260,6 @@ pkinit_as_req_create(krb5_context context,
         auth_pack9->pkAuthenticator.cusec = cusec;
         auth_pack9->pkAuthenticator.nonce = nonce;
         auth_pack9->pkAuthenticator.kdcName = server;
-        auth_pack9->pkAuthenticator.kdcRealm.magic = 0;
-        auth_pack9->pkAuthenticator.kdcRealm.data = server->realm.data;
-        auth_pack9->pkAuthenticator.kdcRealm.length = server->realm.length;
         free(cksum->contents);
         break;
     case KRB5_PADATA_PK_AS_REQ:
index a7cfd66b1b354a114ba4ae91cc49be23b65de7c8..27b1f624f996de9984bd3ee4e31efc2cadb23062 100644 (file)
@@ -630,7 +630,6 @@ static void
 ktest_make_sample_pk_authenticator_draft9(krb5_pk_authenticator_draft9 *p)
 {
     ktest_make_sample_principal(&p->kdcName);
-    ktest_make_sample_data(&p->kdcRealm);
     p->cusec = SAMPLE_USEC;
     p->ctime = SAMPLE_TIME;
     p->nonce = SAMPLE_NONCE;
@@ -1443,7 +1442,6 @@ static void
 ktest_empty_pk_authenticator_draft9(krb5_pk_authenticator_draft9 *p)
 {
     ktest_destroy_principal(&p->kdcName);
-    ktest_empty_data(&p->kdcRealm);
 }
 
 static void