Skip to content

Commit 8cccf56

Browse files
committed
added salt in rsakeypair dto id
1 parent b4d617e commit 8cccf56

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

libs/dao/src/main/java/com/akto/dto/Config.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ public RSAKeyPairConfig(String privateKey, String publicKey) {
965965

966966
public RSAKeyPairConfig(String privateKey, String publicKey, int createdAt) {
967967
this.configType = ConfigType.RSA_KP;
968-
this.id = ConfigType.RSA_KP.name();
968+
this.id = ConfigType.RSA_KP.name() + CONFIG_SALT;
969969
this.privateKey = privateKey;
970970
this.publicKey = publicKey;
971971
this.createdAt = createdAt;

libs/utils/src/main/java/com/akto/utils/RSAKeyPairUtils.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
import com.akto.dto.Config;
77
import com.akto.log.LoggerMaker;
88
import com.akto.log.LoggerMaker.LogDb;
9+
import com.akto.util.Constants;
10+
11+
import static com.akto.dto.Config.CONFIG_SALT;
912

1013
public class RSAKeyPairUtils {
1114

@@ -48,7 +51,7 @@ public static byte[][] fetchKeysFromDb() {
4851
logger.info("Fetching RSA keys from db");
4952

5053
try {
51-
Config.RSAKeyPairConfig rsaKeyPairConfig = (Config.RSAKeyPairConfig) ConfigsDao.instance.findOne("_id", Config.ConfigType.RSA_KP.name());
54+
Config.RSAKeyPairConfig rsaKeyPairConfig = (Config.RSAKeyPairConfig) ConfigsDao.instance.findOne(Constants.ID, Config.ConfigType.RSA_KP.name() + CONFIG_SALT);
5255

5356
if (rsaKeyPairConfig != null) {
5457
logger.info("Found RSA keys config in db");

0 commit comments

Comments
 (0)