Skip to content

Commit

Permalink
- SecretManager#DEFAULT_HMAC_ALGORITHM = HmacSHA256
Browse files Browse the repository at this point in the history
- SecretManager#KEY_LENGTH = 128

Change-Id: I1e8cfb102ce8ab85b12206dc645a9dace56e1b90
  • Loading branch information
K0K0V0K committed Nov 5, 2024
1 parent 8c41fbc commit 79738f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ public void checkAvailableForRead() throws StandbyException {
/**
* The name of the hashing algorithm.
*/
private static final String DEFAULT_HMAC_ALGORITHM = "HmacSHA1";
private static final String DEFAULT_HMAC_ALGORITHM = "HmacSHA256";

/**
* The length of the random keys to use.
*/
private static final int KEY_LENGTH = 64;
private static final int KEY_LENGTH = 128;

/**
* A thread local store for the Macs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public void testRecovery() throws IOException {
new NMTokenSecretManagerInNM(stateStore);
secretMgr.setNodeId(nodeId);
MasterKey currentKey = keygen.generateKey();
// check key is 128 bit long (16 byte)
assertEquals(16, currentKey.getBytes().array().length);
secretMgr.setMasterKey(currentKey);
NMTokenIdentifier attemptToken1 =
getNMTokenId(secretMgr.createNMToken(attempt1, nodeId, "user1"));
Expand Down

0 comments on commit 79738f8

Please sign in to comment.