mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
17 lines
497 B
Java
17 lines
497 B
Java
import javax.crypto.Cipher;
|
|
|
|
class RsaWithoutOaep {
|
|
public void test() throws Exception {
|
|
Cipher rsaBad = Cipher.getInstance("RSA/ECB/NoPadding"); // $hasTaintFlow
|
|
|
|
Cipher rsaGood = Cipher.getInstance("RSA/ECB/OAEPWithSHA-1AndMGF1Padding");
|
|
}
|
|
|
|
public Cipher getCipher(String spec) throws Exception {
|
|
return Cipher.getInstance(spec); // $hasTaintFlow
|
|
}
|
|
|
|
public void test2() throws Exception {
|
|
Cipher rsa = getCipher("RSA/ECB/NoPadding");
|
|
}
|
|
} |