-
Bug
-
Resolution: Fixed
-
P3
-
7u45, 8, 9
-
b36
-
windows_7
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085114 | emb-9 | Anthony Scarpino | P3 | Resolved | Fixed | team |
JDK-8063927 | 8u45 | Jamil Nimeh | P3 | Resolved | Fixed | b01 |
JDK-8057141 | 8u40 | Jamil Nimeh | P3 | Resolved | Fixed | b12 |
JDK-8070010 | emb-8u47 | Jamil Nimeh | P3 | Resolved | Fixed | team |
JDK-8069194 | 7u85 | Ivan Gerasimov | P3 | Resolved | Fixed | b01 |
JDK-8056132 | 7u80 | Ivan Gerasimov | P3 | Resolved | Fixed | b07 |
JDK1.7.0_45
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
In JDK1.7.0_45, CertificateFactory.getInstance("X.509").generateCertificates(in) do not throw CertificateException for invalid input. But in jdk1.6.0_45, it can throw CertificateException for invalid input.
See following JUnit test code:
@org.junit.Test
public void testGenerateCertificates() throws Exception {
byte[] invalidCertBytes = "this is not valid x509 certficate byte array"
.getBytes();
CertificateFactory cf = CertificateFactory.getInstance("X.509");
/*
* Following suppose throw CertificateException. For jdk1.6.0_45_32bit,
* following code can throw CertificateException. But for
* jdk1.7.0_45_64bit, it just return a empty collection.
*/
Collection<? extends Certificate> certs = cf
.generateCertificates(new ByteArrayInputStream(invalidCertBytes));
System.out.println(certs.isEmpty());
}
REGRESSION. Last worked in version 6u45
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the JUnit test code against JDK1.7.0_45.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Throw CertificateException
ACTUAL -
Return a empty collection.
REPRODUCIBILITY :
This bug can be reproduced always.
- backported by
-
JDK-8056132 CertificateFactory.getInstance("X.509").generateCertificates(InputStream) does not throw CertificateException for invalid input
-
- Resolved
-
-
JDK-8057141 CertificateFactory.getInstance("X.509").generateCertificates(InputStream) does not throw CertificateException for invalid input
-
- Resolved
-
-
JDK-8063927 CertificateFactory.getInstance("X.509").generateCertificates(InputStream) does not throw CertificateException for invalid input
-
- Resolved
-
-
JDK-8069194 CertificateFactory.getInstance("X.509").generateCertificates(InputStream) does not throw CertificateException for invalid input
-
- Resolved
-
-
JDK-8070010 CertificateFactory.getInstance("X.509").generateCertificates(InputStream) does not throw CertificateException for invalid input
-
- Resolved
-
-
JDK-8085114 CertificateFactory.getInstance("X.509").generateCertificates(InputStream) does not throw CertificateException for invalid input
-
- Resolved
-
- relates to
-
JDK-8146592 X509Factory throws IllegalArgumentException if parsing error occured
-
- Closed
-