ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1652410 - /webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java
Date Fri, 16 Jan 2015 14:02:29 GMT
Author: coheigea
Date: Fri Jan 16 14:02:29 2015
New Revision: 1652410

URL: http://svn.apache.org/r1652410
Log:
Make sure the audience restriction list is not empty first

Modified:
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java?rev=1652410&r1=1652409&r2=1652410&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java
(original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java
Fri Jan 16 14:02:29 2015
@@ -835,7 +835,8 @@ public class SamlAssertionWrapper {
         
         if (getSamlVersion().equals(SAMLVersion.VERSION_20) && getSaml2().getConditions()
!= null) {
             org.opensaml.saml2.core.Conditions conditions = getSaml2().getConditions();
-            if (conditions != null && conditions.getAudienceRestrictions() != null)
{
+            if (conditions != null && conditions.getAudienceRestrictions() != null
+                && !conditions.getAudienceRestrictions().isEmpty()) {
                 boolean foundAddress = false;
                 for (org.opensaml.saml2.core.AudienceRestriction audienceRestriction 
                     : conditions.getAudienceRestrictions()) {
@@ -858,7 +859,8 @@ public class SamlAssertionWrapper {
             }
         } else if (getSamlVersion().equals(SAMLVersion.VERSION_11) && getSaml1().getConditions()
!= null) {
             org.opensaml.saml1.core.Conditions conditions = getSaml1().getConditions();
-            if (conditions != null && conditions.getAudienceRestrictionConditions()
!= null) {
+            if (conditions != null && conditions.getAudienceRestrictionConditions()
!= null
+                && !conditions.getAudienceRestrictionConditions().isEmpty()) {
                 boolean foundAddress = false;
                 for (org.opensaml.saml1.core.AudienceRestrictionCondition audienceRestriction

                     : conditions.getAudienceRestrictionConditions()) {



Mime
View raw message