mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
Crypto: Fixed bug in WeakSymmetricCipher.qll, forgot to not only filter if !=AES but the algorithm must still be a SymmetriCipher algorithm.
This commit is contained in:
@@ -3,6 +3,7 @@ import javax.crypto.KeyGenerator;
|
||||
import javax.crypto.SecretKey;
|
||||
import java.security.Key;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) throws Exception {
|
||||
@@ -73,5 +74,8 @@ public class Test {
|
||||
Cipher aesGcmCipher = Cipher.getInstance("AES/GCM/NoPadding");
|
||||
aesGcmCipher.init(Cipher.ENCRYPT_MODE, aesKey);
|
||||
byte[] aesGcmEncrypted = aesGcmCipher.doFinal(data);
|
||||
|
||||
// GOOD: not a symmetric cipher (Sanity check)
|
||||
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user