Skip to content

Commit a5ab424

Browse files
committed
Assert current behavior
1 parent c44ac8f commit a5ab424

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/test/java/org/apache/commons/codec/digest/Sha256CryptTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
package org.apache.commons.codec.digest;
1818

19+
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
1920
import static org.junit.jupiter.api.Assertions.assertEquals;
2021
import static org.junit.jupiter.api.Assertions.assertThrows;
2122
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -89,5 +90,7 @@ public void testSha256LargestThanBlocksize() {
8990
final byte[] buffer = new byte[200];
9091
Arrays.fill(buffer, 0, 200, (byte)'A');
9192
assertEquals("$5$abc$HbF3RRc15OwNKB/RZZ5F.1I6zsLcKXHQoSdB9Owx/Q8", Sha2Crypt.sha256Crypt(buffer, "$5$abc"));
93+
// input password is 0-filled on return
94+
assertArrayEquals(new byte[buffer.length], buffer);
9295
}
9396
}

0 commit comments

Comments
 (0)