[java-xmltooling COMMIT] in /branches/REL_1: doc/RELEASE-NOTES.txt src/main/java/org/opensaml/xml/security/keyinfo/pr...

noreply at shibboleth.net noreply at shibboleth.net
Sat Oct 22 20:14:44 BST 2011


Author: putmanb
Date: Sat Oct 22 20:14:43 2011
New Revision: 744

URL: http://svn.shibboleth.net/view/java-xmltooling?rev=744&view=rev
Log:
JXT-81: InlineX509DataProvider should handle X.500 DN string parsing failures more gracefully

Modified:
    branches/REL_1/doc/RELEASE-NOTES.txt
    branches/REL_1/src/main/java/org/opensaml/xml/security/keyinfo/provider/InlineX509DataProvider.java

Modified: branches/REL_1/doc/RELEASE-NOTES.txt
URL: http://svn.shibboleth.net/view/java-xmltooling/branches/REL_1/doc/RELEASE-NOTES.txt?rev=744&r1=743&r2=744&view=diff
==============================================================================
--- branches/REL_1/doc/RELEASE-NOTES.txt (original)
+++ branches/REL_1/doc/RELEASE-NOTES.txt Sat Oct 22 20:14:43 2011
@@ -3,6 +3,7 @@
 [JXT-78] - XSBoolean does not extend XMLObject
 [JXT-79] - Disable RSA v1.5 key transport in favor of RSA-OAEP for all data encryption key types
 [JXT-80] - Update 3rd party runtime library dependencies
+[JXT-81] - InlineX509DataProvider should handle X.500 DN string parsing failures more gracefully
 [JXT-82] - ListView's clear empties the whole backingList instead of only the entries it's responsible for
 [JXT-83] - IndexedXMLObjectChildrenList ListView indexOf and lastIndexOf methods operate on the wrong data
 

Modified: branches/REL_1/src/main/java/org/opensaml/xml/security/keyinfo/provider/InlineX509DataProvider.java
URL: http://svn.shibboleth.net/view/java-xmltooling/branches/REL_1/src/main/java/org/opensaml/xml/security/keyinfo/provider/InlineX509DataProvider.java?rev=744&r1=743&r2=744&view=diff
==============================================================================
--- branches/REL_1/src/main/java/org/opensaml/xml/security/keyinfo/provider/InlineX509DataProvider.java (original)
+++ branches/REL_1/src/main/java/org/opensaml/xml/security/keyinfo/provider/InlineX509DataProvider.java Sat Oct 22 20:14:43 2011
@@ -282,7 +282,14 @@
     protected X509Certificate findCertFromSubjectNames(List<X509Certificate> certs, List<X509SubjectName> names) {
         for (X509SubjectName subjectName : names) {
             if (! DatatypeHelper.isEmpty(subjectName.getValue())) {
-                X500Principal subjectX500Principal = x500DNHandler.parse(subjectName.getValue());
+                X500Principal subjectX500Principal = null;
+                try {
+                    subjectX500Principal = x500DNHandler.parse(subjectName.getValue());
+                } catch (IllegalArgumentException e) {
+                    log.warn("X500 subject name '{}' could not be parsed by configured X500DNHandler '{}'",
+                            subjectName.getValue(), x500DNHandler.getClass().getName());
+                    return null;
+                }
                 for (X509Certificate cert : certs) {
                     if (cert.getSubjectX500Principal().equals(subjectX500Principal)) {
                         return cert;
@@ -308,7 +315,14 @@
             String issuerNameValue = issuerSerial.getX509IssuerName().getValue();
             BigInteger serialNumber  = issuerSerial.getX509SerialNumber().getValue();
             if (! DatatypeHelper.isEmpty(issuerNameValue)) {
-                X500Principal issuerX500Principal = x500DNHandler.parse(issuerNameValue);
+                X500Principal issuerX500Principal = null;
+                try {
+                    issuerX500Principal = x500DNHandler.parse(issuerNameValue);
+                } catch (IllegalArgumentException e) {
+                    log.warn("X500 issuer name '{}' could not be parsed by configured X500DNHandler '{}'",
+                            issuerNameValue, x500DNHandler.getClass().getName());
+                    return null;
+                }
                 for (X509Certificate cert : certs) {
                     if (cert.getIssuerX500Principal().equals(issuerX500Principal) &&
                             cert.getSerialNumber().equals(serialNumber)) {



More information about the commits mailing list