fix:fix homohandler bugs

This commit is contained in:
fanbo 2021-10-15 05:41:24 -07:00
parent 2ce7d65b74
commit a7be50024e
3 changed files with 9 additions and 9 deletions

View File

@ -26,7 +26,7 @@ sourceSets {
dependencies {
implementation project(":common")
implementation project(":mockjava")
implementation project(":MockJava")
implementation 'com.atlassian.commonmark:commonmark:0.17.0'
implementation 'com.idealista:format-preserving-encryption:1.0.0'

View File

@ -548,13 +548,6 @@ public class ContractProcess {
if (fun.isConfidential()) {
fun.appendBeforeInvokeHandler(new ConfidentialHandler(fun));
}
if (fun.isHomomorphicEncrypt()) {
LOGGER.info("injectHandlers--------------------------------1");
fun.appendAfterInvokeHandler(new HomomorphicEncryptHandler(fun));
}
if (fun.isHomomorphicDecrypt()) {
fun.appendAfterInvokeHandler(new HomomorphicDecryptHandler(fun));
}
if (fun.isExport()) {
fun.appendAfterInvokeHandler(new ObjToJsonHandler());
// fun.appendBeforeInvokeHandler(new ReadMeHandler());
@ -568,6 +561,13 @@ public class ContractProcess {
fun.appendAfterInvokeHandler(new MaskHandler());
// }
}
if (fun.isHomomorphicEncrypt()) {
LOGGER.info("injectHandlers--------------------------------1");
fun.appendAfterInvokeHandler(new HomomorphicEncryptHandler(fun));
}
if (fun.isHomomorphicDecrypt()) {
fun.appendAfterInvokeHandler(new HomomorphicDecryptHandler(fun));
}
}
}

View File

@ -56,7 +56,7 @@ public class HomomorphicEncryptHandler implements AnnotationHook {
LOGGER.info("HomomorphicEncryptHandler--------------------------------6: " + homoEncryptConf);
LOGGER.info("HomomorphicEncryptHandler--------------------------------7: " + ret);
LOGGER.info("HomomorphicEncryptHandler--------------------------------8: " + ret.toString());
LOGGER.info("HomomorphicEncryptHandler--------------------------------9: " + JsonUtil.toJson(ret));
// LOGGER.info("HomomorphicEncryptHandler--------------------------------9: " + JsonUtil.toJson(ret));
ret = getEncryptResult(homoEncryptConf, response);
if (ret != null) {
return ret;