Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Assume in DefaultCMM #79

Closed
RustanLeino opened this issue Nov 11, 2019 · 0 comments · Fixed by #203
Closed

Remove Assume in DefaultCMM #79

RustanLeino opened this issue Nov 11, 2019 · 0 comments · Fixed by #203

Comments

@RustanLeino
Copy link
Contributor

DefaultCMM.GetEncryptionMaterials contains:

MessageHeader.AssumeValidAAD(enc_ec);

This unchecked assumption should be removed. Replacing it with a run-time check seems appropriate, probably here but possibly later (during serialization).

@lavaleri lavaleri self-assigned this Jan 9, 2020
@MatthewBennington MatthewBennington added this to the Public Beta milestone Jan 24, 2020
@lavaleri lavaleri removed their assignment Feb 21, 2020
@lavaleri lavaleri assigned lavaleri and RustanLeino and unassigned lavaleri Feb 27, 2020
RustanLeino added a commit that referenced this issue Feb 29, 2020
* fix: Trade AssumeValidAAD for run-time checks and proofs

DefaultCMM.GetEncryptionMaterials is given a valid encryption context, to which it may
append the mapping `[reservedField := enc_vk]`. This would invalidate the encryption
context if the new entry causes problems with the size limits.

* `reservedField` is not UTF8 or is too long (but we know it's fine, because it's a constant)

* `enc_vk` is not UTF8 or is too long after it has been Base64 encoded (but we know it's fine, because of the new and
  tested postcondition of `Signature.KeyGen`, and because of some new specifications and lemmas regarding `Base64.Encode`)

* the updated encryption context exceeds the maximum number of allowed mappings (this is now run-time checked)

* the updated encryption context contains too many bytes altogether (this is now run-time checked, which involves
   walking over all the entries in the encryption context--possibly expensive)

Fixes #79

* Remove AssumeValidAAD altogether

The previous uses of AssumeValidAAD in test/SDK/Serialize.dfy have now been replaced
by proofs, found in test/Util/TestUtils.dfy.

* Respond to PR comment

* Replace extern postcondition with runtime check
josecorella pushed a commit to josecorella/aws-encryption-sdk-dafny that referenced this issue Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants