awslabs / aws-encryption-sdk-specification

AWS Encryption SDK Specification
Other
29 stars 27 forks source link

Allow for non-sequential frame IV values in decryption #229

Open robin-aws opened 3 years ago

robin-aws commented 3 years ago

In https://github.com/awslabs/aws-encryption-sdk-specification/blob/master/client-apis/decrypt.md#decrypt-the-message-body:

"The IV is the sequence number used in the message body AAD above, padded to the IV length with 0."

This is actually too restrictive, because the message format includes an IV field in each frame which should be the source of this value. It happens that most ESDK implementations now use sequential IV values when encrypting (https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/IV-reference.html), but ESDKs still need to be able to parse older messages or ones created by other implementations.