C#: Move sinks into System.Security.Cryptography framework code.

This commit is contained in:
Michael Nebel
2022-07-18 14:28:24 +02:00
parent c91d49a0fe
commit 57ba0c4e5d
2 changed files with 20 additions and 12 deletions

View File

@@ -42,3 +42,23 @@ private class SystemSecurityCryptographyOidCollectionFlowModelCsv extends Summar
]
}
}
/** Sinks for `System.Security.Cryptography`. */
private class SystemSecurityCryptographySinkModelCsv extends SinkModelCsv {
override predicate row(string row) {
row =
[
"System.Security.Cryptography;SymmetricAlgorithm;true;CreateEncryptor;(System.Byte[],System.Byte[]);;Argument[0];encryption-encryptor;manual",
"System.Security.Cryptography;SymmetricAlgorithm;true;CreateDecryptor;(System.Byte[],System.Byte[]);;Argument[0];encryption-decryptor;manual",
"System.Security.Cryptography;SymmetricAlgorithm;true;set_Key;(System.Byte[]);;Argument[0];encryption-keyprop;manual",
]
}
}
/** Sinks for `Windows.Security.Cryptography.Core`. */
private class WindowsSecurityCryptographyCoreSinkModelCsv extends SinkModelCsv {
override predicate row(string row) {
row =
"Windows.Security.Cryptography.Core;SymmetricKeyAlgorithmProvider;false;CreateSymmetricKey;(Windows.Storage.Streams.IBuffer);;Argument[0];encryption-symmetrickey;manual"
}
}

View File

@@ -39,18 +39,6 @@ module HardcodedSymmetricEncryptionKey {
StringLiteralSource() { this.asExpr() instanceof StringLiteral }
}
private class SymmetricAlgorithmSinkCsv extends SinkModelCsv {
override predicate row(string row) {
row =
[
"System.Security.Cryptography;SymmetricAlgorithm;true;CreateEncryptor;(System.Byte[],System.Byte[]);;Argument[0];encryption-encryptor;manual",
"System.Security.Cryptography;SymmetricAlgorithm;true;CreateDecryptor;(System.Byte[],System.Byte[]);;Argument[0];encryption-decryptor;manual",
"System.Security.Cryptography;SymmetricAlgorithm;true;set_Key;(System.Byte[]);;Argument[0];encryption-keyprop;manual",
"Windows.Security.Cryptography.Core;SymmetricKeyAlgorithmProvider;false;CreateSymmetricKey;(Windows.Storage.Streams.IBuffer);;Argument[0];encryption-symmetrickey;manual"
]
}
}
private class SymmetricAlgorithmSink extends Sink {
private string kind;