Skip to content

Commit

Permalink
one log message is enough
Browse files Browse the repository at this point in the history
  • Loading branch information
shikhar committed Jun 29, 2010
1 parent 34a7b8e commit efc7702
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/net/schmizz/sshj/DefaultConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ protected void initCipherFactories() {
new TripleDESCBC.Factory(),
new BlowfishCBC.Factory()));

boolean warn = false;
// Ref. https://issues.apache.org/jira/browse/SSHD-24
// "AES256 and AES192 requires unlimited cryptography extension"
for (Iterator<Factory.Named<Cipher>> i = avail.iterator(); i.hasNext();) {
Expand All @@ -144,10 +145,12 @@ protected void initCipherFactories() {
final byte[] iv = new byte[c.getIVSize()];
c.init(Cipher.Mode.Encrypt, key, iv);
} catch (Exception e) {
log.warn("Disabling cipher `{}`: cipher strengths apparently limited by JCE policy", f.getName());
warn = true;
i.remove();
}
}
if (warn)
log.warn("Disabling high-strength ciphers: cipher strengths apparently limited by JCE policy");

setCipherFactories(avail);
}
Expand Down

0 comments on commit efc7702

Please sign in to comment.