asn1_decode_k.c (asn1_decode_kdc_req_body): If the authorization field
authorTheodore Tso <tytso@mit.edu>
Wed, 19 Oct 1994 15:45:23 +0000 (15:45 +0000)
committerTheodore Tso <tytso@mit.edu>
Wed, 19 Oct 1994 15:45:23 +0000 (15:45 +0000)
is not present, fill in the authorization data fields with all zeros.
Don't set kvno (that's *key* version number, not *Kerberos* version
number) to 5.

err2kerr.c (KRB5_KRB__ERROR2krb5_error): The e_data field wasn't being
decoded when it should have been.

qbuf2data.c (qbuf2krb5_data): Set magic number field to zero.

tgrq2ktgrq.c (KRB5_KDC__REQ__BODY2krb5_kdc_req): Allow the service
principal to be optional.

ktgrq2tgrq.c (krb5_kdc_req2KRB5_KDC__REQ__BODY): ditto

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

src/lib/krb5/asn.1/ChangeLog
src/lib/krb5/asn.1/KRB5-asn.py
src/lib/krb5/asn.1/asn1_decode_k.c
src/lib/krb5/asn.1/err2kerr.c
src/lib/krb5/asn.1/ktgrq2tgrq.c
src/lib/krb5/asn.1/qbuf2data.c
src/lib/krb5/asn.1/tgrq2ktgrq.c

index 276c379128dddaf29431618d9dc42efa1c3bce18..6b7e5ba25774bb35767a8f4191a2530af4eefb7f 100644 (file)
@@ -1,3 +1,23 @@
+Wed Oct 19 10:51:16 1994  Theodore Y. Ts'o  (tytso@maytag)
+
+       * err2kerr.c (KRB5_KRB__ERROR2krb5_error): The e_data field
+               wasn't being decoded when it should have been.
+
+       * qbuf2data.c (qbuf2krb5_data): Set magic number field to zero.
+
+       * asn1_decode_k.c (asn1_decode_kdc_req_body): If the authorization
+               field is not present, fill in the authorization data
+               fields with all zeros.  Don't set kvno (that's *key*
+               version number, not *Kerberos* version number) to 5.
+
+Tue Oct 18 23:07:20 1994  Theodore Y. Ts'o  (tytso@maytag)
+
+       * tgrq2ktgrq.c (KRB5_KDC__REQ__BODY2krb5_kdc_req): Allow the
+               service principal to be optional.
+
+       * ktgrq2tgrq.c (krb5_kdc_req2KRB5_KDC__REQ__BODY): Allow the
+               server principal to be optional.
+
 Fri Oct  7 15:05:35 1994  Theodore Y. Ts'o  (tytso@dcl)
 
        * Makefile.isode.in: Add -DKRB5_USE_ISODE so that include files
index 60a66f6f95c4d13dbb9a352d55b179a93f6fe73b..07e967a22434c824467bbc0edbdd4514ccc682b2 100644 (file)
@@ -155,7 +155,7 @@ KDC-REQ-BODY ::=    SEQUENCE {
         kdc-options[0] KDCOptions,
         cname[1]       PrincipalName OPTIONAL, -- Used only in AS-REQ
         realm[2]       Realm, -- Server's realm  Also client's in AS-REQ
-        sname[3]       PrincipalName,
+        sname[3]       PrincipalName OPTIONAL,
         from[4]        KerberosTime OPTIONAL,
         till[5]        KerberosTime,
         rtime[6]       KerberosTime OPTIONAL,
index b4a928a5a3624d81c8a3599daf4eb22f300403c2..7526b864ad9ea33070850b8def579c86552e6791 100644 (file)
@@ -415,8 +415,9 @@ asn1_error_code asn1_decode_kdc_req_body(DECLARG(asn1buf *, buf),
     if(tagnum == 10){
       get_field(val->authorization_data,10,asn1_decode_encrypted_data); }
     else{
+      val->authorization_data.magic = 0;
       val->authorization_data.etype = 0;
-      val->authorization_data.kvno = KVNO;
+      val->authorization_data.kvno = 0;
       val->authorization_data.ciphertext.data = NULL;
       val->authorization_data.ciphertext.length = 0;
     }
index 4380eac9e0a528b29e695e00dcd48dd46e83e308..8d6fa557bc5ebe9cf915b2b9e43d13f86f1d4a95 100644 (file)
@@ -97,9 +97,9 @@ register int *error;
        }
     }
     if (val->e__data) {
-       temp = qbuf2krb5_data(val->e__text, error);
+       temp = qbuf2krb5_data(val->e__data, error);
        if (temp) {
-           retval->text = *temp;
+           retval->e_data = *temp;
            krb5_xfree(temp);
        } else {
            goto errout;
index a92d6df46b95711d2d2243b2e879ffb940338538..b0213fd52a751be941ab7c302bc03d3ed426ab2c 100644 (file)
@@ -65,16 +65,35 @@ register int *error;
        if (!retval->cname) {
            goto errout;
        }
-    }    
-    retval->realm = krb5_data2qbuf(krb5_princ_realm(val->server));
-    if (!retval->realm) {
-       *error = ENOMEM;
-       goto errout;
     }
-    retval->sname = krb5_principal2KRB5_PrincipalName(val->server, error);
-    if (!retval->sname) {
+    if (val->server) {
+       retval->realm = krb5_data2qbuf(krb5_princ_realm(val->server));
+       if (!retval->realm) {
+           *error = ENOMEM;
+           goto errout;
+       }
+       retval->sname = krb5_principal2KRB5_PrincipalName(val->server, error);
+       if (!retval->sname) {
+           goto errout;
+       }
+    } else if (val->client) {
+       retval->realm = krb5_data2qbuf(krb5_princ_realm(val->client));
+       if (!retval->realm) {
+           *error = ENOMEM;
+           goto errout;
+       }
+    } else if (val->second_ticket && val->second_ticket[0] &&
+              val->second_ticket[0]->server) {
+       retval->realm = krb5_data2qbuf(krb5_princ_realm(val->second_ticket[0]->server));
+       if (!retval->realm) {
+           *error = ENOMEM;
+           goto errout;
+       }
+    } else {
+       *error = EINVAL;
        goto errout;
     }
+    
     if (val->from) {
        retval->from = unix2gentime(val->from, error);
        if (!retval->from) {
index 8865fe5c2ede296a23357fd897d8faba49fed4ab..c4f400312b6304cbd5ccb2a0de71dffa1a3349a4 100644 (file)
@@ -58,6 +58,7 @@ register int *error;
        retval->data = 0;
        return retval;
     }
+    retval->magic = 0;
     retval->data = (char *)xmalloc(val->qb_forw->qb_len);
     if (!retval->data) {
        krb5_xfree(retval);
index fdf5293cccd02e7ec78912aff600aff3d219063f..381b067510ae11d61e90bc93d8a9e72ce917a69c 100644 (file)
@@ -62,17 +62,25 @@ register int *error;
        krb5_free_kdc_req(retval);
        return(0);
     }
-    if (val->cname)
+    if (val->cname) {
        retval->client =
            KRB5_PrincipalName2krb5_principal(val->cname,
                                              val->realm,
                                              error);
-    retval->server = KRB5_PrincipalName2krb5_principal(val->sname,
-                                                      val->realm,
-                                                      error);
-    if (!retval->server) {
-       goto errout;
+       if (*error) {
+           goto errout;
+       }
+    }
+           
+    if (val->sname) {
+       retval->server = KRB5_PrincipalName2krb5_principal(val->sname,
+                                                          val->realm,
+                                                          error);
+       if (*error) {
+           goto errout;
+       }
     }
+
     if (val->from) {
        retval->from = gentime2unix(val->from, error);
        if (*error) {