< prev index next >

src/java.security.jgss/share/classes/sun/security/krb5/KrbApReq.java

Print this page
rev 15878 : 8168518: rcache interop with krb5-1.15

@@ -299,13 +299,14 @@
         }
 
         if (!authenticator.ctime.inClockSkew())
             throw new KrbApErrException(Krb5.KRB_AP_ERR_SKEW);
 
+        String alg = AuthTimeWithHash.DEFAULT_HASH_ALG;
         byte[] hash;
         try {
-            hash = MessageDigest.getInstance("MD5")
+            hash = MessageDigest.getInstance(AuthTimeWithHash.realAlg(alg))
                     .digest(apReqMessg.authenticator.cipher);
         } catch (NoSuchAlgorithmException ex) {
             throw new AssertionError("Impossible");
         }
 

@@ -317,10 +318,11 @@
         AuthTimeWithHash time = new AuthTimeWithHash(
                 authenticator.cname.toString(),
                 apReqMessg.ticket.sname.toString(),
                 authenticator.ctime.getSeconds(),
                 authenticator.cusec,
+                alg,
                 new String(h));
         rcache.checkAndStore(KerberosTime.now(), time);
 
         if (initiator != null) {
             // sender host address
< prev index next >