[cpp-xmltooling COMMIT] /branches/REL_1/xmltooling/security/impl/AbstractPKIXTrustEngine.cpp

noreply at shibboleth.net noreply at shibboleth.net
Thu Aug 11 19:56:40 BST 2011


Author: scantor
Date: Thu Aug 11 19:56:40 2011
New Revision: 902

URL: http://svn.shibboleth.net/view/cpp-xmltooling?rev=902&view=rev
Log:
Handle null criteria when trusted names are set

Modified:
    branches/REL_1/xmltooling/security/impl/AbstractPKIXTrustEngine.cpp

Modified: branches/REL_1/xmltooling/security/impl/AbstractPKIXTrustEngine.cpp
URL: http://svn.shibboleth.net/view/cpp-xmltooling/branches/REL_1/xmltooling/security/impl/AbstractPKIXTrustEngine.cpp?rev=902&r1=901&r2=902&view=diff
==============================================================================
--- branches/REL_1/xmltooling/security/impl/AbstractPKIXTrustEngine.cpp (original)
+++ branches/REL_1/xmltooling/security/impl/AbstractPKIXTrustEngine.cpp Thu Aug 11 19:56:40 2011
@@ -692,11 +692,20 @@
         return false;
     }
 
-    if ((criteria && criteria->getPeerName() && *(criteria->getPeerName())) || !m_trustedNames.empty()) {
+    if (criteria && criteria->getPeerName() && *(criteria->getPeerName())) {
         log.debug("checking that the certificate name is acceptable");
         if (criteria && criteria->getUsage()==Credential::UNSPECIFIED_CREDENTIAL)
             criteria->setUsage(Credential::SIGNING_CREDENTIAL);
         if (!checkEntityNames(certEE,credResolver,*criteria)) {
+            log.error("certificate name was not acceptable");
+            return false;
+        }
+    }
+    else if (!m_trustedNames.empty()) {
+        log.debug("checking that the certificate name is acceptable");
+        CredentialCriteria cc;
+        cc.setUsage(Credential::SIGNING_CREDENTIAL);
+        if (!checkEntityNames(certEE,credResolver,cc)) {
             log.error("certificate name was not acceptable");
             return false;
         }



More information about the commits mailing list