Skip to content

Commit

Permalink
Merge pull request #710 from mzcu/add-gcm-siv
Browse files Browse the repository at this point in the history
Add GCM-SIV to authenticated cipher mode list
  • Loading branch information
h3xstream committed Jul 26, 2023
2 parents b8754c6 + c3b0146 commit b4726c1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class CipherWithNoIntegrityDetector extends OpcodeStackDetector {
private static final String PADDING_ORACLE_TYPE = "PADDING_ORACLE";
private static final String CIPHER_INTEGRITY_TYPE = "CIPHER_INTEGRITY";

private static final Pattern AUTHENTICATED_CIPHER_MODES = Pattern.compile(".*/(CCM|CWC|OCB|EAX|GCM)/.*");
private static final Pattern AUTHENTICATED_CIPHER_MODES = Pattern.compile(".*/(CCM|CWC|OCB|EAX|GCM(-SIV)?)/.*");
private static final Pattern INSECURE_ECB_MODES = Pattern.compile("(AES|DES(ede)?)(/ECB/.*)?");

private final BugReporter bugReporter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void detectNoIntegrity() throws Exception {
.build()
);

List<Integer> linesNoIntegrity = Arrays.asList(9, 10, 11, 12, 21);
List<Integer> linesNoIntegrity = Arrays.asList(9, 10, 11, 12, 22);
for (Integer line : linesNoIntegrity) {
verify(reporter).doReportBug(
bugDefinition()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static void main(String[] args) throws Exception {
Cipher.getInstance("RSA/ECB/PKCS1Padding"); // ok
Cipher.getInstance(args[0]); // ok
Cipher.getInstance("ECIES"); // ok this is elliptic curve
Cipher.getInstance("AES/GCM-SIV/NoPadding"); // ok
}

private Cipher cipher;
Expand Down

0 comments on commit b4726c1

Please sign in to comment.