activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbertram <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #1139: ARTEMIS-1074 Acceptors/Connectors now s...
Date Tue, 28 Mar 2017 17:13:53 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message