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 extra EC requirement from GetEncryptionMaterials in CMM interface #210

Closed
lavaleri opened this issue Feb 27, 2020 · 2 comments
Closed

Comments

@lavaleri
Copy link
Contributor

The CMM interface should not require that the EC on GetEncryptionMaterials not have the reserved keys, or require an EC that is serializable. This is because we do not specify all CMMs to have this requirement on inputs, and also because the Default CMM should be checking this dynamically anyway. Either the check logic needs to be in the shim code or in the dafny code, so we might as well put it in the dafny code and verify the expected behavior for particular inputs.

A result of this is that we no longer can statically verify that the DefaultCMM's EC does not have the reserved field. This is because a class implementing a method from an interface cannot have more restrictive preconditions than the interface. Instead we must dynamically check that the EC has those extra requirements, and decide what to do if the EC is not as we expect. This requires should be replaced by an ensures that makes sure the implementation performs the correct behavior.

@seebees
Copy link
Contributor

seebees commented Feb 27, 2020

Is this a candidate for expect @robin-aws ?

@robin-aws
Copy link
Contributor

Possibly: depends on whether the API has to raise a specific type of error for this case, i.e. something that becomes a specific exception class that we document. If it does, we need to use Result<T> types and :- statements to propagate the error. expect is definitely simpler if not.

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

No branches or pull requests

5 participants