Yair Zaslavsky has posted comments on this change.

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


Patch Set 1: (5 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";
+1.
Let's take of it later.
Line 22:     }
Line 23: 
Line 24:     public static void init() {
Line 25:         File trustStoreFile = new File(getTrustStorePath());


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/provider/ImportProviderCertificateChainCommand.java
Line 60:         if (chain != null && chain.size() > 0) {
Line 61:             KeyStore ks = null;
Line 62:             try {
Line 63:                 ks = ExternalTrustStoreInitializer.getTrustStore();
Line 64:             } catch (RuntimeException e) {
I would suggest catch (Throwable  ) to really cover all the cases.
Line 65:                 handleException(e);
Line 66:             }
Line 67: 
Line 68:             try {


....................................................
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 {
Notice also the asSingleResult that  - yes, can help us with other cases, not 
just Dao, I guess whoever created this class needed some helper methods for 
reocurring cases.
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/modules/utils/src/main/java/org/ovirt/engine/core/utils/crypt/EngineEncryptionUtils.java
Line 62:             );
Line 63:         } finally {
Line 64:             if (in != null) {
Line 65:                 try {
Line 66:                     in.close();
When will you move to JDK7 ? :)
Line 67:                 } catch (IOException e) {
Line 68:                     log.error("Cannot close key store", e);
Line 69:                 }
Line 70:             }


Line 143:         if (source == null || source.trim().length() == 0) {
Line 144:             return "";
Line 145:         }
Line 146:         else {
Line 147:             Cipher rsa = Cipher.getInstance("RSA");
WIll we want to support other algorithms besides RSA?
Line 148:             rsa.init(Cipher.ENCRYPT_MODE, 
getCertificate().getPublicKey());
Line 149:             return new Base64(0).encodeToString(
Line 150:                 
rsa.doFinal(source.trim().getBytes(Charset.forName("UTF-8")))
Line 151:             );


-- 
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