Allon Mureinik has uploaded a new change for review.

Change subject: core: Return source string if blank is passed
......................................................................

core: Return source string if blank is passed

Patch e0b50e8f4caef63f42d192457f1b8a8d6390a379 Removed EncryptionUtils
and introduced EngineEncryptionUtils.
It also inadvertently introduced a behaviour change in the
encrypt/decrypt methods - returning "" if the given string was blank
instead of the old behaviour of returning null if the original was null.
Note that this change broke the DAO tests

This patch returns the old behaviour in order to allow the DAO tests to
run.

Change-Id: If2882371e84c92b0e087a5db8658512ae7875e52
Signed-off-by: Allon Mureinik <amure...@redhat.com>
---
M 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/crypt/EngineEncryptionUtils.java
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/42/16242/1

diff --git 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/crypt/EngineEncryptionUtils.java
 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/crypt/EngineEncryptionUtils.java
index 7ef8c73..5eb4ab4 100644
--- 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/crypt/EngineEncryptionUtils.java
+++ 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/crypt/EngineEncryptionUtils.java
@@ -141,7 +141,7 @@
      */
     public static String encrypt(String source) throws 
GeneralSecurityException {
         if (source == null || source.trim().length() == 0) {
-            return "";
+            return source;
         }
         else {
             Cipher rsa = Cipher.getInstance("RSA");
@@ -161,7 +161,7 @@
      */
     public static String decrypt(String source) throws 
GeneralSecurityException {
         if (source == null || source.trim().length() == 0) {
-            return "";
+            return source;
         }
         else {
             Cipher rsa = Cipher.getInstance("RSA");


-- 
To view, visit http://gerrit.ovirt.org/16242
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If2882371e84c92b0e087a5db8658512ae7875e52
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amure...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to