Yaniv Bronhaim has posted comments on this change.

Change subject: pki: introduce the EngineEncryptionUtils
......................................................................


Patch Set 1: (4 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/provider/ExternalTrustStoreInitializer.java
Line 17:     private static final String FILE_URL_PREFIX = "file://";
Line 18: 
Line 19:     private static String getTrustStorePath() {
Line 20:         File varDir = EngineLocalConfig.getInstance().getVarDir();
Line 21:         return varDir + "/" + "external_truststore";
return EngineLocalConfig.getInstance().getVarDir() + "/" + 
"external_truststore";

and constant for "/external_truststore" is better
Line 22:     }
Line 23: 
Line 24:     public static void init() {
Line 25:         File trustStoreFile = new File(getTrustStorePath());


Line 37:     }
Line 38: 
Line 39:     public static KeyStore getTrustStore() {
Line 40:         try (InputStream in = new 
FileInputStream(getTrustStorePath())) {
Line 41:             // TODO: do not use password of other store
you don't use password of other store. do you still need the todo comment?
Line 42:             String password = 
EngineLocalConfig.getInstance().getPKITrustStorePassword();
Line 43:             KeyStore ks = KeyStore.getInstance("JKS");
Line 44:             ks.load(in, password.toCharArray());
Line 45:             return ks;


....................................................
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/DbFacadeUtils.java
Line 7: import org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils;
Line 8: import org.ovirt.engine.core.utils.log.Log;
Line 9: import org.ovirt.engine.core.utils.log.LogFactory;
Line 10: 
Line 11: public class DbFacadeUtils {
why is it DbFacadeUtils if its only encrypt decrypt and create Date object? For 
me this util looks a bit redundant, you could call directly to 
EngineEncryptionUtils.encrypt(password), decrypt and new Date(..)
Line 12:     private static final Log log = 
LogFactory.getLog(DbFacadeUtils.class);
Line 13: 
Line 14:     public static Date fromDate(Timestamp timestamp) {
Line 15:         if (timestamp == null) {


....................................................
File 
backend/manager/tools/src/main/java/org/ovirt/engine/core/config/entity/helper/PasswordValueHelper.java
Line 27:     }
Line 28: 
Line 29:     String decrypt(String value) throws Exception {
Line 30:         return EngineEncryptionUtils.decrypt(value);
Line 31:     }
call directly to EngineEncryptionUtils.decrypt, no need to wrap it.
Line 32: 
Line 33:     @Override
Line 34:     public String getValue(String value) throws 
GeneralSecurityException {
Line 35:         /*


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I10af516c2f35bb853ccae42a03e3ec4b98ce5efb
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to