Change encrypt=true fields to no longer have a pre-pended salt value.
This is done by just setting the length of salt bytes to 0, but still having a length byte prepended. Add a feature to allow for certain fields to actually have a salt prefix. This is enabled by setting encrypt=salt in the entity definition. This change is slightly incompatible with existing code. Old database values will continue to be decrypted correctly. However, newly encrypted values will no longer have a salt prepended, while originally they would. This shouldn't be a problem in practice. This change, along with the previous commit, finally allow for direct lookup of encrypted values. However, already stored values will not be found. To fix those, each database row will have to be read in by ofbiz, then immediately written back out. This is part two to completely fix OFBIZ-5959: Person.socialSecurityNumber can't be used for findByAnd. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1604968 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -711,7 +711,8 @@ public class WebToolsServices {
|
||||
javaNameMap.put("type", (field.getType()) != null ? field.getType() : null);
|
||||
javaNameMap.put("javaType", (field.getType() != null && type != null) ? type.getJavaType() : "Undefined");
|
||||
javaNameMap.put("sqlType", (type != null && type.getSqlType() != null) ? type.getSqlType() : "Undefined");
|
||||
javaNameMap.put("encrypted", field.getEncrypt());
|
||||
javaNameMap.put("encrypted", field.getEncryptMethod().isEncrypted());
|
||||
javaNameMap.put("encryptMethod", field.getEncryptMethod());
|
||||
javaNameList.add(javaNameMap);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user