mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Crypto: Add modeling for JCA signatures. Make consistent use of "unknown" or "other" for unrecognized types.
This commit is contained in:
@@ -16,7 +16,7 @@ module Types {
|
||||
TSignature(TSignatureAlgorithmType t) or
|
||||
TMac(TMacAlgorithmType t) or
|
||||
TKeyEncapsulation(TKemAlgorithmType t) or
|
||||
TUnknownKeyOperationAlgorithmType()
|
||||
TOtherKeyOperationAlgorithmType()
|
||||
|
||||
// Parameterized algorithm types
|
||||
newtype TSymmetricCipherType =
|
||||
@@ -64,7 +64,7 @@ module Types {
|
||||
newtype TCipherStructureType =
|
||||
Block() or
|
||||
Stream() or
|
||||
UnknownCipherStructureType()
|
||||
OtherCipherStructureType()
|
||||
|
||||
class CipherStructureType extends TCipherStructureType {
|
||||
string toString() {
|
||||
@@ -72,7 +72,7 @@ module Types {
|
||||
or
|
||||
result = "Stream" and this = Stream()
|
||||
or
|
||||
result = "Unknown" and this = UnknownCipherStructureType()
|
||||
result = "Unknown" and this = OtherCipherStructureType()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ module Types {
|
||||
or
|
||||
type = OtherSymmetricCipherType() and
|
||||
name = "UnknownSymmetricCipher" and
|
||||
s = UnknownCipherStructureType()
|
||||
s = OtherCipherStructureType()
|
||||
}
|
||||
|
||||
class AlgorithmType extends TAlgorithm {
|
||||
@@ -157,7 +157,7 @@ module Types {
|
||||
this = TMac(OtherMacAlgorithmType()) and result = "UnknownMac"
|
||||
or
|
||||
// Unknown
|
||||
this = TUnknownKeyOperationAlgorithmType() and result = "Unknown"
|
||||
this = TOtherKeyOperationAlgorithmType() and result = "Unknown"
|
||||
}
|
||||
|
||||
int getImplicitKeySize() {
|
||||
|
||||
Reference in New Issue
Block a user