Skip to content

Conversation

@ItalyPaleAle
Copy link
Contributor

This PR adds support for AES-CBC-HMAC in the Dapr crypto package, which is an AEAD cipher based on AES-CBC.

This code is needed by both the crypto building block (dapr/proposals#3) and the Dapr state store encryption v2 (dapr/dapr#6027)

Includes:

  • Adding the AES-CBC-HMAC cipher in the package crypto/aescbcaead, implemented according to draft RFC and RFC 7518 Section 5.
  • Adds support for these algorithms when using encryption with local storage components. JWA (JSON Web Algorithm) identifiers are:
    • A128CBC-HS256
    • A192CBC-HS384
    • A256CBC-HS512

Signed-off-by: ItalyPaleAle <[email protected]>
Signed-off-by: ItalyPaleAle <[email protected]>
- Moved packages out of internal
- Fixed Overhead() in AES-CBC-HMAC code
- Added last tests

Signed-off-by: ItalyPaleAle <[email protected]>
@ItalyPaleAle ItalyPaleAle requested review from a team as code owners March 19, 2023 01:52
@codecov-commenter
Copy link

Codecov Report

Merging #40 (3b124d7) into main (b5bafe8) will decrease coverage by 0.64%.
The diff coverage is 74.04%.

@@            Coverage Diff             @@
##             main      #40      +/-   ##
==========================================
- Coverage   80.64%   80.01%   -0.64%     
==========================================
  Files          25       26       +1     
  Lines        1354     1481     +127     
==========================================
+ Hits         1092     1185      +93     
- Misses        197      217      +20     
- Partials       65       79      +14     
Impacted Files Coverage Δ
crypto/padding/pkcs7_padding.go 100.00% <ø> (ø)
crypto/symmetric.go 51.41% <50.00%> (-1.70%) ⬇️
crypto/aescbcaead/aescbcaead.go 83.15% <83.15%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ItalyPaleAle ItalyPaleAle merged commit efcc1af into dapr:main Mar 21, 2023
@ItalyPaleAle ItalyPaleAle deleted the aes-cbc-aead branch March 21, 2023 00:36
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 this pull request may close these issues.

3 participants