Skip to content

Commit 1d405db

Browse files
committed
C#: Collapse Sink classes.
1 parent 383ad51 commit 1d405db

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

csharp/ql/lib/semmle/code/csharp/security/cryptography/HardcodedSymmetricEncryptionKey.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ module HardcodedSymmetricEncryptionKey {
5858
}
5959

6060
private class SymmetricAlgorithmCreateEncryptorSink extends Sink {
61-
SymmetricAlgorithmCreateEncryptorSink() { sinkNode(this, "encryption-encryptor") }
61+
private string kind;
6262

63-
override string getDescription() { result = "Encryptor(rgbKey, IV)" }
64-
}
65-
66-
private class SymmetricAlgorithmCreateDecryptorSink extends Sink {
67-
SymmetricAlgorithmCreateDecryptorSink() { sinkNode(this, "encryption-decryptor") }
63+
SymmetricAlgorithmCreateEncryptorSink() { sinkNode(this, kind) and kind.matches("encryption%") }
6864

69-
override string getDescription() { result = "Decryptor(rgbKey, IV)" }
65+
override string getDescription() {
66+
kind = "encryption-encryptor" and result = "Encryptor(rgbKey, IV)"
67+
or
68+
kind = "encryption-decryptor" and result = "Decryptor(rgbKey, IV)"
69+
}
7070
}
7171

7272
private class CreateSymmetricKeySink extends Sink {

0 commit comments

Comments
 (0)