diff --git a/test/sun/security/krb5/auto/KDC.java b/test/sun/security/krb5/auto/KDC.java index af8fca976ac841775fdb070c00539c4ddc07fbe7..247d4184536eab384a8111ec6415a7566322868b 100644 --- a/test/sun/security/krb5/auto/KDC.java +++ b/test/sun/security/krb5/auto/KDC.java @@ -1279,7 +1279,17 @@ public class KDC { PAData[] inPAs = KDCReqDotPAData(asReq); List enc_outPAs = new ArrayList<>(); - if (inPAs == null || inPAs.length == 0) { + + byte[] paEncTimestamp = null; + if (inPAs != null) { + for (PAData inPA : inPAs) { + if (inPA.getType() == Krb5.PA_ENC_TIMESTAMP) { + paEncTimestamp = inPA.getValue(); + } + } + } + + if (paEncTimestamp == null) { Object preauth = options.get(Option.PREAUTH_REQUIRED); if (preauth == null || preauth.equals(Boolean.TRUE)) { throw new KrbException(Krb5.KDC_ERR_PREAUTH_REQUIRED); @@ -1288,7 +1298,7 @@ public class KDC { EncryptionKey pakey = null; try { EncryptedData data = newEncryptedData( - new DerValue(inPAs[0].getValue())); + new DerValue(paEncTimestamp)); pakey = keyForUser(body.cname, data.getEType(), false); data.decrypt(pakey, KeyUsage.KU_PA_ENC_TS); } catch (Exception e) {