Crypto: Fix off by one column issue in unit tests.

This commit is contained in:
REDMOND\brodes
2025-10-22 15:50:33 -04:00
parent 3561d01144
commit 08379393b3
5 changed files with 5 additions and 5 deletions

View File

@@ -31,6 +31,6 @@ nodes
| BadMacUse.java:124:42:124:51 | ciphertext | semmle.label | ciphertext |
subpaths
testFailures
| BadMacUse.java:63:118:63:128 | // $Source | Missing result: Source |
| BadMacUse.java:63:118:63:127 | // $Source | Missing result: Source |
| BadMacUse.java:92:16:92:36 | doFinal(...) : byte[] | Unexpected result: Source |
| BadMacUse.java:124:42:124:51 | ciphertext | Unexpected result: Alert |

View File

@@ -11,4 +11,4 @@ nodes
| BadMacUse.java:76:44:76:52 | plaintext | semmle.label | plaintext |
subpaths
testFailures
| BadMacUse.java:50:56:50:66 | // $Source | Missing result: Source |
| BadMacUse.java:50:56:50:65 | // $Source | Missing result: Source |

View File

@@ -122,7 +122,7 @@ class BadMacUse {
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(macKey);
byte[] computedMac = mac.doFinal(ciphertext); // False Positive
// Concatenate ciphertext and MAC
byte[] output = new byte[ciphertext.length + computedMac.length];
System.arraycopy(ciphertext, 0, output, 0, ciphertext.length);

View File

@@ -1,5 +1,5 @@
#select
| Test.java:47:22:47:49 | KeyDerivation | Key derivation operation with unknown iteration: $@ | Test.java:43:53:43:70 | iterationCount | iterationCount |
testFailures
| Test.java:45:94:45:154 | // $Alert[java/quantum/examples/unknown-kdf-iteration-count] | Missing result: Alert[java/quantum/examples/unknown-kdf-iteration-count] |
| Test.java:45:94:45:153 | // $Alert[java/quantum/examples/unknown-kdf-iteration-count] | Missing result: Alert[java/quantum/examples/unknown-kdf-iteration-count] |
| Test.java:47:22:47:49 | Key derivation operation with unknown iteration: $@ | Unexpected result: Alert |

View File

@@ -13,4 +13,4 @@ nodes
| Test.java:59:72:59:85 | iterationCount | semmle.label | iterationCount |
subpaths
testFailures
| Test.java:43:92:43:102 | // $Source | Missing result: Source |
| Test.java:43:92:43:101 | // $Source | Missing result: Source |