Github user jbertram commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1139#discussion_r108480518
  
    --- Diff: 
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/DefaultSensitiveStringCodec.java
 ---
    @@ -139,8 +140,12 @@ private void updateKey(String key) {
           public String decode(String secret) throws Exception {
              SecretKeySpec key = new SecretKeySpec(internalKey, "Blowfish");
     
    -         BigInteger n = new BigInteger((String) secret, 16);
    -         byte[] encoding = n.toByteArray();
    +         byte[] encoding;
    +         try {
    +            encoding = new BigInteger(secret, 16).toByteArray();
    +         } catch (Exception ex) {
    +            throw new IllegalArgumentException("Password must be 
encrypted.");
    --- End diff --
    
    I think it would also be worth logging the original exception at debug 
level.  Be sure to wrap the log statement in `if (logger.isDebugEnabled())`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to