src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java
--- a/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java Mon Jun 25 10:54:55 2018 +0200
+++ b/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java Tue Mar 20 11:16:10 2018 +0530
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -234,14 +234,12 @@
* @exception GSSException may be thrown
*/
public int getInitLifetime() throws GSSException {
- int retVal = 0;
Date d = getEndTime();
if (d == null) {
return 0;
}
- retVal = (int)(d.getTime() - (new Date().getTime()));
-
- return retVal/1000;
+ long retVal = d.getTime() - System.currentTimeMillis();
+ return (int)(retVal/1000);
}
/**