JDK-6857802 : GSS getRemainingInitLifetime method returns milliseconds not seconds
  • Type: Bug
  • Component: security-libs
  • Sub-Component: org.ietf.jgss:krb5
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2009-07-07
  • Updated: 2010-11-04
  • Resolved: 2009-07-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6 JDK 7
5.0u23Fixed 6u18Fixed 7 b66Fixed
Description
FULL PRODUCT VERSION :
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)


ADDITIONAL OS VERSION INFORMATION :
Linux  2.6.26.8-57.fc8 #1 SMP Thu Dec 18 19:19:45 EST 2008 i686 i686 i386 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
The method getRemainingInitLifetime returnd milliseconds not seconds.

The specificaton states that the return values are seconds.

In sun.security.jgss.krb5.Krb5InitCredential

    /**
     * Returns the init lifetime remaining.
     *
     * @return the init lifetime remaining in seconds
     * @exception GSSException may be thrown
     */
    public int getInitLifetime() throws GSSException {
	int retVal = 0;
	retVal = (int)(getEndTime().getTime()
		       - (new Date().getTime()));
	
	return retVal;
    }

java.util.Date.getTime() returns milliseconds.



STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a GSS initiate credential and display the results of getRemainingInitLifetime

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Values in seconds
ACTUAL -
Values in milliseconds

REPRODUCIBILITY :
This bug can be reproduced always.

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/tl/jdk/rev/1175f872a968
08-07-2009