Skip to content

Commit e7535b3

Browse files
committed
Crypto: Updating JCA to use new key size predicate returning int for elliptic curve.
1 parent dfbe08d commit e7535b3

File tree

2 files changed

+4
-9
lines changed
  • java/ql/lib/experimental/quantum
  • shared/quantum/codeql/quantum/experimental

2 files changed

+4
-9
lines changed

java/ql/lib/experimental/quantum/JCA.qll

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,13 +1606,8 @@ module JCAModel {
16061606
else result = Crypto::OtherEllipticCurveType()
16071607
}
16081608

1609-
override string getKeySize() {
1610-
exists(int keySize |
1611-
Crypto::ellipticCurveNameToKeySizeAndFamilyMapping(this.getRawEllipticCurveName(), keySize,
1612-
_)
1613-
|
1614-
result = keySize.toString()
1615-
)
1609+
override int getKeySize() {
1610+
Crypto::ellipticCurveNameToKeySizeAndFamilyMapping(this.getRawEllipticCurveName(), result, _)
16161611
}
16171612

16181613
EllipticCurveAlgorithmValueConsumer getConsumer() { result = consumer }

shared/quantum/codeql/quantum/experimental/Model.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ module CryptographyBase<LocationSig Location, InputSig<Location> Input> {
972972

973973
abstract TEllipticCurveType getEllipticCurveType();
974974

975-
abstract string getKeySize();
975+
abstract int getKeySize();
976976

977977
/**
978978
* The 'parsed' curve name, e.g., "P-256" or "secp256r1"
@@ -2613,7 +2613,7 @@ module CryptographyBase<LocationSig Location, InputSig<Location> Input> {
26132613
or
26142614
// [ONLY_KNOWN]
26152615
key = "KeySize" and
2616-
value = instance.asAlg().getKeySize() and
2616+
value = instance.asAlg().getKeySize().toString() and
26172617
location = this.getLocation()
26182618
or
26192619
// [KNOWN_OR_UNKNOWN]

0 commit comments

Comments
 (0)