WIP Adding necessary crysl rules to support ECIES #95
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request is not getting merged at the moment due to rules causing false positives. The false positives are caused as third party API data flows are not getting analysed. See the last comment for more information.
This pull request adds crysl rules for classes that are necessary for the ECIES encryption scheme #83.
BSI states in section 3.4 that there are 3 main components to ECIES:
Symmetric encryption: already supported by the current bouncycastle ruleset.
MAC: HMAC, GMAC, CMAC are recommended. HMAC is supported by the current bouncycastle ruleset.
Key derivation functions: Not supported by the current bouncycastle ruleset.
BSI recommends key derivation through Extraction-then-Expansion.
The bouncycastle class KDF2BytesGenerator implements that scheme.
MGF1BytesGenerator would also be a candidate but the current IESCipher class doesn't support that class.
KDF2BytesGenerator.crysl is added with the corresponding KDFParameters.crysl
Besides symmetric encryption, MAC, and key derivation. A key agreement is part of ECIES.
Crysl rule for ECDHBasicAgreement.crysl is therefore added.
The class that runs the ECIES encryption scheme in the bouncycastle is the IESCipher and the underlying IESEngine.
Rules for both classes are added. The constraints for both classes are mostly realized through the REQUIRES section.
Concerning is https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-1000345
Notable changes to AsymmetricCipherKeyPair. Added missing method calls getPrivate and getPublic. As AsymmetricCipherKeyPair
can be used for RSAKeys or ECKeys the crysl rule now ENSURES a lot of predicates.
Furthermore to allow the pair to only be of EC or RSA the CONSTRAINTS section is added.