This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: RFC: X509 parsing fix
- From: Tom Tromey <tromey at redhat dot com>
- To: classpath-patches at gnu dot org
- Cc: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 20 Jan 2006 17:03:36 -0700
- Subject: Patch: RFC: X509 parsing fix
- Reply-to: tromey at redhat dot com
I've been looking at this bug:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=174708
This is actually two separate bugs -- an EOF exception in Jessie, and
an X509 parsing bug in Classpath. I believe the latter buglet was
introduced here:
http://lists.gnu.org/archive/html/classpath-patches/2005-07/msg00156.html
Also while looking at this I noticed that there is similar X509
parsing code in Jessie, and it seems to already have the appended
change in it.
I'd appreciate comments from people who actually understand this code
in depth...
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* gnu/java/security/x509/X509Certificate.java (parse):
Unconditionally read value; for version==1 case when reading
algorithm ID.
Index: gnu/java/security/x509/X509Certificate.java
===================================================================
--- gnu/java/security/x509/X509Certificate.java (revision 109835)
+++ gnu/java/security/x509/X509Certificate.java (working copy)
@@ -1,5 +1,5 @@
/* X509Certificate.java -- X.509 certificate.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -661,10 +661,7 @@
der.skip(spki.getLength());
logger.log (Component.X509, "read subjectPublicKey == {0}", subjectKey);
- if (version > 1)
- {
- val = der.read();
- }
+ val = der.read();
if (version >= 2 && val.getTagClass() != DER.UNIVERSAL && val.getTag() == 1)
{
byte[] b = (byte[]) val.getValue();