gnodet commented on code in PR #9629:
URL: https://github.com/apache/camel-quarkus/pull/9629#discussion_r4787497746


##########
extensions/tls-registry/runtime/src/main/java/org/apache/camel/quarkus/core/tls/TlsConfigurationConverter.java:
##########
@@ -234,6 +235,16 @@ private static KeyStore copyKeyEntries(TlsConfiguration 
tlsConfig, String name,
         }
     }
 
+    /**
+     * Generate the password of an in-memory key store. The KeyStore API needs 
one to hold a private key, and components
+     * need it to read the key back. At 64 characters it meets the minimum of 
32 for FIPS providers.
+     */
+    private static String generatePassword() {
+        byte[] bytes = new byte[32];
+        new SecureRandom().nextBytes(bytes);
+        return HexFormat.of().formatHex(bytes);

Review Comment:
   **Excellent security improvement** ✅
   
   The use of `SecureRandom` and 64-character passwords (32 bytes in hex) is 
exactly right for cryptographic operations. This:
   - Exceeds the FIPS minimum of 32 characters
   - Provides ~256 bits of entropy 
   - Eliminates secret scanner false positives
   - Generates a unique password per bean instance
   
   The implementation in `generatePassword()` is clean and straightforward.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to