Skip to content

Commit e16ce56

Browse files
authored
RANGER-5337: Exception/Error handling in FIPS MK creation failure flow (#698)
1 parent 15ae650 commit e16ce56

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

kms/src/main/java/org/apache/hadoop/crypto/key/RangerKeyStoreProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public RangerKeyStoreProvider(Configuration conf) throws Throwable {
239239
try {
240240
tempMK = masterKeyProvider.getMasterKey(password).toCharArray();
241241
} catch (Throwable e) {
242-
throw new RuntimeException("Error while getting Ranger Master key, Error - " + e.getMessage());
242+
throw new RuntimeException("Error while getting Ranger Master key", e);
243243
}
244244
}
245245

kms/src/main/java/org/apache/hadoop/crypto/key/RangerMasterKey.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ public void generateMKFromKeySecureMK(String password, byte[] key) throws Throwa
362362
String savedKey = saveEncryptedMK(paddingString + "," + encryptedMasterKey);
363363

364364
if (savedKey != null && !savedKey.trim().equals("")) {
365-
logger.debug("Master Key Created with id = " + savedKey);
365+
logger.debug("Master Key Created with id = {}", savedKey);
366366
}
367367
} else {
368368
logger.debug("Ranger Master Key already exists in the DB, returning.");

0 commit comments

Comments
 (0)