JDK-6336392 : X509V3/interop tese failed due to cert toString contains java.io.IOException
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2005-10-13
  • Updated: 2010-11-04
  • Resolved: 2006-10-16
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.
JDK 6
6 b63Fixed
Related Reports
Relates :  
Description
The following codes:

X509Certificate cert= (X509Certificate) cf.generateCertificate(new FileInputStream("cert.in"));
FileOutputStream certOut= new FileOutputStream("cert.out");
certOut.write(cert.toString().getBytes());
certOut.close();

The cert.out contains the following IOException:

Unparseable certificate extensions: 1
[1]: ObjectId: 2.5.29.17 Criticality=false
Unparseable SubjectAlternativeName extension due to
java.io.IOException: Invalid encoding of RFC822 name

0000: 30 34 A1 1A 16 18 65 73   63 65 72 74 2D 75 70 63  04....escert-upc
0010: 40 65 73 63 65 72 74 2E   75 70 63 2E 65 73 A6 16  @escert.upc.es..
0020: 16 14 68 74 74 70 3A 2F   2F 65 73 63 65 72 74 2E  ..http://escert.
0030: 75 70 63 2E 65 73                                  upc.es
0000: 30 34 A1 1A 16 18 65 73   63 65 72 74 2D 75 70 63  04....escert-upc
0010: 40 65 73 63 65 72 74 2E   75 70 63 2E 65 73 A6 16  @escert.upc.es..
0020: 16 14 68 74 74 70 3A 2F   2F 65 73 63 65 72 74 2E  ..http://escert.
0030: 75 70 63 2E 65 73                                  upc.es

While one other solaris 10 x86 it generates the following:

Unparseable certificate extensions: 1
[1]: ObjectId: 2.5.29.17 Criticality=false
0000: 30 34 A1 1A 16 18 65 73   63 65 72 74 2D 75 70 63  04....escert-upc
0010: 40 65 73 63 65 72 74 2E   75 70 63 2E 65 73 A6 16  @escert.upc.es..
0020: 16 14 68 74 74 70 3A 2F   2F 65 73 63 65 72 74 2E  ..http://escert.
0030: 75 70 63 2E 65 73                                  upc.es

These toString encodings at least don't conform to each other. They should be conformative.
This only happens on some particular cert files. The following two cert files are of these types.
/net/sqesvr-nfs/global/nfs/sec/ws_6.0_int/security/src/X509V3/interop/badCerts/certv3.crt.data
/net/sqesvr-nfs/global/nfs/sec/ws_6.0_int/security/src/X509V3/interop/badCerts/myset.crt.data

Comments
EVALUATION From: ###@###.### Subject: Re: 6336392 - closed as 'Not a Defect' yet it was integrated? To: ###@###.### Cc: ###@###.### Sorry, 6336392 itself is not a bug (in fact the SQE test does not fail) so I close it. Later I think I can change the format of an error message
04-12-2005

SUGGESTED FIX --- /net/shimmer.sfbay/export/home/otto/nightlies/mustang/ws/j2se/webrev/src/share/classes/sun/security/x509/X509CertInfo.java- Mon Nov 28 13:54:06 2005 +++ X509CertInfo.java Mon Nov 28 13:32:17 2005 @@ -1,7 +1,7 @@ /* - * @(#)X509CertInfo.java 1.36 05/09/26 + * @(#)X509CertInfo.java 1.37 05/11/14 * * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ @@ -37,11 +37,11 @@ * <LI>A <em>Serial Number</em> assigned by the CA, for use in * certificate revocation and other applications. * * @author Amit Kapoor * @author Hemma Prafullchandra - * @version 1.36 + * @version 1.37 * @see CertAttrSet * @see X509CertImpl */ public class X509CertInfo implements CertAttrSet { /** @@ -332,12 +332,10 @@ sb.append("\nUnparseable certificate extensions: " + invalid.size()); int i = 1; for (Extension ext : invalid.values()) { sb.append("\n[" + (i++) + "]: "); sb.append(ext); - HexDumpEncoder enc = new HexDumpEncoder(); - sb.append(enc.encodeBuffer(ext.getExtensionValue())); } } } sb.append("\n]"); return sb.toString();
04-12-2005