You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2013/02/07 00:28:06 UTC

[18/23] git commit: refs/heads/vim51_win8 - If encryption is already initialized we don't need to do it again.

If encryption is already initialized we don't need to do it again.

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

Branch: refs/heads/vim51_win8
Commit: b28f3addfc63b6a2bf9e76b0230f716e9ef7f51c
Parents: b1d70f7
Author: Hugo Trippaers <ht...@schubergphilis.com>
Authored: Wed Feb 6 16:49:12 2013 +0100
Committer: Hugo Trippaers <ht...@schubergphilis.com>
Committed: Wed Feb 6 16:49:12 2013 +0100

----------------------------------------------------------------------
 .../utils/crypt/EncryptionSecretKeyChecker.java    |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/b28f3add/utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java b/utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java
index c717a3a..5ffa14f 100755
--- a/utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java
+++ b/utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java
@@ -71,6 +71,11 @@ public class EncryptionSecretKeyChecker extends AdapterBase implements SystemInt
             if(encryptionType == null || encryptionType.equals("none")){
                 return;
             }
+            
+            if (s_useEncryption) {
+            	s_logger.warn("Encryption already enabled, is check() called twice?");
+            	return;
+            }
 
             s_encryptor.setAlgorithm("PBEWithMD5AndDES");
             String secretKey = null;