Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9FFF9172E5 for ; Wed, 8 Apr 2015 09:05:27 +0000 (UTC) Received: (qmail 54539 invoked by uid 500); 8 Apr 2015 09:05:27 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 54510 invoked by uid 500); 8 Apr 2015 09:05:27 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 54501 invoked by uid 99); 8 Apr 2015 09:05:27 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Apr 2015 09:05:27 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 32B17E02A1; Wed, 8 Apr 2015 09:05:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bhaisaab@apache.org To: commits@cloudstack.apache.org Message-Id: <7d0b41699a934756b90bd1a02e469c09@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/4.5 to 6c5cf04 Date: Wed, 8 Apr 2015 09:05:27 +0000 (UTC) Repository: cloudstack Updated Branches: refs/heads/4.5 272dab159 -> 6c5cf04d6 CLOUDSTACK-8372: Encrypt key column when saving key in keystore table Signed-off-by: Rohit Yadav Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6c5cf04d Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6c5cf04d Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6c5cf04d Branch: refs/heads/4.5 Commit: 6c5cf04d6242cd23cc1e7ea982529df9f27fcb1c Parents: 272dab1 Author: Rohit Yadav Authored: Wed Apr 8 14:29:55 2015 +0530 Committer: Rohit Yadav Committed: Wed Apr 8 14:35:17 2015 +0530 ---------------------------------------------------------------------- .../cloudstack/framework/security/keystore/KeystoreDaoImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c5cf04d/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreDaoImpl.java ---------------------------------------------------------------------- diff --git a/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreDaoImpl.java b/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreDaoImpl.java index b856582..8a8754d 100644 --- a/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreDaoImpl.java +++ b/framework/security/src/org/apache/cloudstack/framework/security/keystore/KeystoreDaoImpl.java @@ -25,6 +25,7 @@ import javax.ejb.Local; import org.springframework.stereotype.Component; +import com.cloud.utils.crypt.DBEncryptionUtil; import com.cloud.utils.db.DB; import com.cloud.utils.db.GenericDaoBase; import com.cloud.utils.db.SearchBuilder; @@ -104,10 +105,10 @@ public class KeystoreDaoImpl extends GenericDaoBase implements PreparedStatement pstmt = txn.prepareAutoCloseStatement(sql); pstmt.setString(1, name); pstmt.setString(2, certificate); - pstmt.setString(3, key); + pstmt.setString(3, DBEncryptionUtil.encrypt(key)); pstmt.setString(4, domainSuffix); pstmt.setString(5, certificate); - pstmt.setString(6, key); + pstmt.setString(6, DBEncryptionUtil.encrypt(key)); pstmt.setString(7, domainSuffix); pstmt.executeUpdate();