cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [03/10] git commit: updated refs/heads/master to d46e459
Date Fri, 12 Sep 2014 15:16:37 GMT
SAMLUtils: Fix NPE incase signature is generated with a null privateKey

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5a0ed876
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5a0ed876
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5a0ed876

Branch: refs/heads/master
Commit: 5a0ed8764be12cbf028f829d2db1d1af01a8a283
Parents: a66127d
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Fri Sep 12 15:46:44 2014 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Fri Sep 12 15:46:44 2014 +0200

----------------------------------------------------------------------
 utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5a0ed876/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
----------------------------------------------------------------------
diff --git a/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java b/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
index 82e840a..b085e49 100644
--- a/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
+++ b/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
@@ -218,6 +218,9 @@ public class SAMLUtils {
 
     public static String generateSAMLRequestSignature(String urlEncodedString, PrivateKey
signingKey)
             throws NoSuchAlgorithmException, SignatureException, InvalidKeyException, UnsupportedEncodingException
{
+        if (signingKey == null || urlEncodedString == null) {
+            return null;
+        }
         String url = urlEncodedString + "&SigAlg=" + URLEncoder.encode(SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA1,
HttpUtils.UTF_8);
         Signature signature = Signature.getInstance("SHA1withRSA");
         signature.initSign(signingKey);


Mime
View raw message