Skip to content

Commit ec5c1b3

Browse files
authored
KRATool: Update DES3 key size documentation to recommend 192 bits (#5404)
The previous documentation recommended users specify 168 for DES3, but the code internally uses 192 bits for PKCS#11 operations. This caused confusion when users saw "192-bit DES3" in logs after specifying 168. Changes: - Update help text to recommend 192 for DES3 (was 168) - Remove 168 from documented options (still accepted for backward compatibility) - Update error message to list only documented options (128, 192, 256) - Add missing javadoc @PARAM keyType in importSessionKeyToToken() Users can still specify 168 if needed (it works the same), but 192 is now the recommended and documented value. Assisted-by: Claude Related to: IDM-4508
1 parent b7c6afa commit ec5c1b3

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

base/tools/src/main/java/com/netscape/cmstools/KRATool.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ public class KRATool {
821821
" " + " (must match target KRA's configured algorithm)";
822822

823823
private static final String SOURCE_PAYLOAD_WRAP_KEYSIZE = "-source_payload_wrap_keysize";
824-
private static final String SOURCE_PAYLOAD_WRAP_KEYSIZE_DESCRIPTION = " <128|168|192|256> Source payload wrapping key size in bits (default: 128, use 168 for DES3)";
824+
private static final String SOURCE_PAYLOAD_WRAP_KEYSIZE_DESCRIPTION = " <128|192|256> Source payload wrapping key size in bits (default: 128, use 192 for DES3)";
825825

826826
private static final String TARGET_PAYLOAD_WRAP_KEYSIZE = "-target_payload_wrap_keysize";
827827
private static final String TARGET_PAYLOAD_WRAP_KEYSIZE_DESCRIPTION = " <128|192|256> Target payload wrapping key size in bits (default: 128, AES only)";
@@ -2742,7 +2742,8 @@ private static void initTempRSAKeyPair(CryptoToken processingToken) throws Excep
27422742
*
27432743
* Reference: JSS_ExportEncryptedPrivKeyInfoV2 -> JSS_KeyExchange in jssutil.c:1146-1241
27442744
*
2745-
* @param sessionKey Source session key
2745+
* @param sessionKey Session key to import (from source token)
2746+
* @param keyType Type of the session key (SymmetricKey.Type - DES3 or AES)
27462747
* @param processingToken Token for processing (HSM or NSS DB)
27472748
* @return Session key in processing token
27482749
*/
@@ -7274,7 +7275,7 @@ public static void main(String[] args) {
72747275
mSourcePayloadWrapKeySize = Integer.parseInt(args[i + 1]);
72757276
if (mSourcePayloadWrapKeySize != 128 && mSourcePayloadWrapKeySize != 168 &&
72767277
mSourcePayloadWrapKeySize != 192 && mSourcePayloadWrapKeySize != 256) {
7277-
System.err.println("ERROR: Source payload wrapping key size must be 128, 168, 192, or 256" + NEWLINE);
7278+
System.err.println("ERROR: Source payload wrapping key size must be 128, 192, or 256" + NEWLINE);
72787279
System.exit(1);
72797280
}
72807281
} catch (NumberFormatException e) {

0 commit comments

Comments
 (0)