< prev index next >

src/java.security.jgss/share/classes/sun/security/krb5/internal/KDCReq.java

Print this page

        

@@ -57,13 +57,13 @@
  * http://www.ietf.org/rfc/rfc4120.txt</a>.
  */
 public class KDCReq {
 
     public KDCReqBody reqBody;
-    public PAData[] pAData = null; //optional
     private int pvno;
     private int msgType;
+    private PAData[] pAData = null; //optional
 
     public KDCReq(PAData[] new_pAData, KDCReqBody new_reqBody,
             int req_type) throws IOException {
         pvno = Krb5.PVNO;
         msgType = req_type;

@@ -142,11 +142,27 @@
                 throw new KrbApErrException(Krb5.KRB_AP_ERR_MSG_TYPE);
             }
         } else {
             throw new Asn1Exception(Krb5.ASN1_BAD_ID);
         }
-        pAData = PAData.parseSequence(der.getData(), (byte) 0x03, true);
+        if ((der.getData().peekByte() & 0x1F) == 0x03) {
+            subDer = der.getData().getDerValue();
+            DerValue subsubDer = subDer.getData().getDerValue();
+            if (subsubDer.getTag() != DerValue.tag_SequenceOf) {
+                throw new Asn1Exception(Krb5.ASN1_BAD_ID);
+            }
+            Vector<PAData> v = new Vector<>();
+            while (subsubDer.getData().available() > 0) {
+                v.addElement(new PAData(subsubDer.getData().getDerValue()));
+            }
+            if (v.size() > 0) {
+                pAData = new PAData[v.size()];
+                v.copyInto(pAData);
+            }
+        } else {
+            pAData = null;
+        }
         subDer = der.getData().getDerValue();
         if ((subDer.getTag() & 0x01F) == 0x04) {
             DerValue subsubDer = subDer.getData().getDerValue();
             reqBody = new KDCReqBody(subsubDer, msgType);
         } else {
< prev index next >