Skip to content

Commit 2f5c2dd

Browse files
committed
JCE: return defensive copy of IV in engineGetIV to prevent internal state mutation
1 parent 4b6fbf1 commit 2f5c2dd

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/java/com/wolfssl/provider/jce/WolfCryptCipher.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,11 @@ else if (paddingType == PaddingType.WC_PKCS5) {
697697

698698
@Override
699699
protected byte[] engineGetIV() {
700-
return this.iv;
700+
if (this.iv != null) {
701+
return this.iv.clone();
702+
}
703+
704+
return null;
701705
}
702706

703707
@Override

0 commit comments

Comments
 (0)