Author: ruchithf
Date: Mon Dec 19 13:49:05 2011
New Revision: 1220746

URL: http://svn.apache.org/viewvc?rev=1220746&view=rev
Log:
Applying Amila's patch for RAMPART-347

Modified:
    
axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/errors.properties
    
axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/impl/SAMLTokenIssuer.java

Modified: 
axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/errors.properties
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/errors.properties?rev=1220746&r1=1220745&r2=1220746&view=diff
==============================================================================
--- 
axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/errors.properties
 (original)
+++ 
axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/errors.properties
 Mon Dec 19 13:49:05 2011
@@ -49,6 +49,7 @@ notSupported = Not supported: {0}
 errorCreatingSymmKey = Error in creating the ephemeral key
 badDispatcherConfigMultipleDefaultIssuers = Dispatcher configuration error : 
There should be only one default issuer
 errorInBuildingTheEncryptedKeyForPrincipal = Error in building encrypted key 
for principal : \"{0}\"
+trustedCertNotFoundForEPR = Trusted certificate not found for service address 
: \"{0}\"
 invlidTTL = timeToLive (in milliseconds) must be a positive long value.
 invalidKeysize = Invalid key size
 unsupportedWSTVersion = Unsupported WS-Trust version

Modified: 
axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/impl/SAMLTokenIssuer.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/impl/SAMLTokenIssuer.java?rev=1220746&r1=1220745&r2=1220746&view=diff
==============================================================================
--- 
axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/impl/SAMLTokenIssuer.java
 (original)
+++ 
axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/impl/SAMLTokenIssuer.java
 Mon Dec 19 13:49:05 2011
@@ -318,11 +318,21 @@ public class SAMLTokenIssuer implements 
                 // Extract the Encryptedkey DOM element
                 encryptedKeyElem = encrKeyBuilder.getEncryptedKeyElement();
             } catch (WSSecurityException e) {
-                throw new TrustException(
-                        "errorInBuildingTheEncryptedKeyForPrincipal",
-                        new String[] { serviceCert.getSubjectDN().getName() },
-                        e);
+
+                if (serviceCert != null) {
+                    throw new TrustException(
+                            "errorInBuildingTheEncryptedKeyForPrincipal",
+                            new String[]{serviceCert.getSubjectDN().getName()},
+                            e);
+                } else {
+                    throw new TrustException(
+                            "trustedCertNotFoundForEPR",
+                            new String[]{data.getAppliesToAddress()},
+                            e);
+                }
+
             }
+
             return this.createAttributeAssertion(doc, data ,encryptedKeyElem, 
config,
                     crypto, creationTime, expirationTime);
         } else {


Reply via email to