cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1457956 - /cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
Date Mon, 18 Mar 2013 20:05:16 GMT
Author: dkulp
Date: Mon Mar 18 20:05:16 2013
New Revision: 1457956

URL: http://svn.apache.org/r1457956
Log:
Merged revisions 1457480 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1457480 | ashakirin | 2013-03-17 12:24:13 -0400 (Sun, 17 Mar 2013) | 2 lines

  Fixed [CXF-4897]

........

Modified:
    cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java

Modified: cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java?rev=1457956&r1=1457955&r2=1457956&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
(original)
+++ cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
Mon Mar 18 20:05:16 2013
@@ -137,9 +137,13 @@ public class DefaultSubjectProvider impl
             }
             cryptoType.setAlias(encryptionName);
             try {
-                X509Certificate certificate = crypto.getX509Certificates(cryptoType)[0];
+                X509Certificate[] certs = crypto.getX509Certificates(cryptoType);
+                if (certs == null || certs.length <= 0) {
+                    new STSException("Encryption certificate is not found for alias: " +
encryptionName,
+                                     STSException.REQUEST_FAILED);
+                }
                 KeyInfoBean keyInfo = 
-                    createKeyInfo(certificate, secret, doc, encryptionProperties, crypto);
+                    createKeyInfo(certs[0], secret, doc, encryptionProperties, crypto);
                 subjectBean.setKeyInfo(keyInfo);
             } catch (WSSecurityException ex) {
                 LOG.log(Level.WARNING, "", ex);



Mime
View raw message