mirror of
https://github.com/github/codeql.git
synced 2026-04-22 07:15:15 +02:00
Swift: Make the RNCryptor sources wider (actual usage seems to vary).
This commit is contained in:
@@ -50,8 +50,12 @@ private class DefaultConstantPasswordSink extends ConstantPasswordSink {
|
||||
private class RnCryptorPasswordSink extends ConstantPasswordSink {
|
||||
RnCryptorPasswordSink() {
|
||||
// RNCryptor (labelled arguments)
|
||||
exists(ClassOrStructDecl c, MethodDecl f, CallExpr call |
|
||||
c.getName() = ["RNCryptor", "RNEncryptor", "RNDecryptor"] and
|
||||
exists(NominalTypeDecl c, MethodDecl f, CallExpr call |
|
||||
c.getName() =
|
||||
[
|
||||
"RNCryptor", "RNEncryptor", "RNDecryptor", "RNCryptor.EncryptorV3",
|
||||
"RNCryptor.DecryptorV3"
|
||||
] and
|
||||
c.getAMember() = f and
|
||||
call.getStaticTarget() = f and
|
||||
call.getArgumentWithLabel(["password", "withPassword", "forPassword"]).getExpr() =
|
||||
|
||||
@@ -49,8 +49,12 @@ private class CryptoSwiftSaltSink extends ConstantSaltSink {
|
||||
*/
|
||||
private class RnCryptorSaltSink extends ConstantSaltSink {
|
||||
RnCryptorSaltSink() {
|
||||
exists(ClassOrStructDecl c, MethodDecl f, CallExpr call |
|
||||
c.getName() = ["RNCryptor", "RNEncryptor", "RNDecryptor"] and
|
||||
exists(NominalTypeDecl c, MethodDecl f, CallExpr call |
|
||||
c.getName() =
|
||||
[
|
||||
"RNCryptor", "RNEncryptor", "RNDecryptor", "RNCryptor.EncryptorV3",
|
||||
"RNCryptor.DecryptorV3"
|
||||
] and
|
||||
c.getAMember() = f and
|
||||
call.getStaticTarget() = f and
|
||||
call.getArgumentWithLabel(["salt", "encryptionSalt", "hmacSalt", "HMACSalt"]).getExpr() =
|
||||
|
||||
@@ -52,8 +52,12 @@ private class CryptoSwiftEncryptionKeySink extends HardcodedEncryptionKeySink {
|
||||
*/
|
||||
private class RnCryptorEncryptionKeySink extends HardcodedEncryptionKeySink {
|
||||
RnCryptorEncryptionKeySink() {
|
||||
exists(ClassOrStructDecl c, MethodDecl f, CallExpr call |
|
||||
c.getFullName() = ["RNCryptor", "RNEncryptor", "RNDecryptor"] and
|
||||
exists(NominalTypeDecl c, MethodDecl f, CallExpr call |
|
||||
c.getFullName() =
|
||||
[
|
||||
"RNCryptor", "RNEncryptor", "RNDecryptor", "RNCryptor.EncryptorV3",
|
||||
"RNCryptor.DecryptorV3"
|
||||
] and
|
||||
c.getAMember() = f and
|
||||
call.getStaticTarget() = f and
|
||||
call.getArgumentWithLabel(["encryptionKey", "withEncryptionKey"]).getExpr() = this.asExpr()
|
||||
|
||||
@@ -51,8 +51,12 @@ private class CryptoSwiftInitializationVectorSink extends StaticInitializationVe
|
||||
*/
|
||||
private class RnCryptorInitializationVectorSink extends StaticInitializationVectorSink {
|
||||
RnCryptorInitializationVectorSink() {
|
||||
exists(ClassOrStructDecl c, MethodDecl f, CallExpr call |
|
||||
c.getFullName() = ["RNCryptor", "RNEncryptor", "RNDecryptor"] and
|
||||
exists(NominalTypeDecl c, MethodDecl f, CallExpr call |
|
||||
c.getFullName() =
|
||||
[
|
||||
"RNCryptor", "RNEncryptor", "RNDecryptor", "RNCryptor.EncryptorV3",
|
||||
"RNCryptor.DecryptorV3"
|
||||
] and
|
||||
c.getAMember() = f and
|
||||
call.getStaticTarget() = f and
|
||||
call.getArgumentWithLabel(["iv", "IV"]).getExpr() = this.asExpr()
|
||||
|
||||
Reference in New Issue
Block a user