forsthofer commented on a change in pull request #5068:
URL: https://github.com/apache/camel/pull/5068#discussion_r574445291
##########
File path:
core/camel-support/src/main/java/org/apache/camel/converter/stream/CipherPair.java
##########
@@ -61,7 +60,18 @@ public Cipher getEncryptor() {
return enccipher;
}
- public Cipher getDecryptor() {
- return deccipher;
+ /**
+ * Create the decryptor every time because the decryptor is not thead
safe. For example, if you reuse the decryptor
+ * instance in the Multi-cast case then you will get errors.
+ */
+ public Cipher createDecryptor() {
+ try {
+ Cipher deccipher = Cipher.getInstance(transformation);
+ deccipher.init(Cipher.DECRYPT_MODE, key, ivp == null ? null : new
IvParameterSpec(ivp));
+ return deccipher;
+ } catch (GeneralSecurityException e) {
+ // should not happen
+ throw new IllegalStateException("Could not instanciate decryptor,
e");
Review comment:
I have corrected this in a further commit
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]