diff options
author | Vadim Sukhomlinov <sukhomlinov@google.com> | 2019-08-22 13:19:37 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-12-06 23:48:32 +0000 |
commit | 47fb09677c6b52618349773730db122f1089f97f (patch) | |
tree | 7eb8074d08f04acd697374554ab543d1c9764dea /board | |
parent | d2ffa5f72aae0fcbc5aea7c985d09680f201a08f (diff) | |
download | chrome-ec-47fb09677c6b52618349773730db122f1089f97f.tar.gz |
g: Add support for 192 and 256 bit AES-GCM in DCRYPTO_gcm_init
DCRYPTO_gcm_init hardcoded key length to 128 bit causing preventing
testing of 192 and 256 bit functionality for AES-GCM.
BUG=b:135623371
BRANCH=cr50
TEST=compile, specific test for issue as described in bug
Change-Id: I4fc41f6155661709115c57aa944c8976e17bffac
Signed-off-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1766098
Reviewed-by: Andrey Pronin <apronin@chromium.org>
(cherry picked from commit 24f7511e41c1f8140b19d69d9440a3ea6f91bd89)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1954339
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/cr50/tpm2/aes.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/board/cr50/tpm2/aes.c b/board/cr50/tpm2/aes.c index cc4d83d7e7..5fe431222a 100644 --- a/board/cr50/tpm2/aes.c +++ b/board/cr50/tpm2/aes.c @@ -403,7 +403,8 @@ static void aes_command_handler(void *cmd_body, size_t count; struct GCM_CTX ctx; - DCRYPTO_gcm_init(&ctx, key_local.b, iv_local.b, iv_len); + DCRYPTO_gcm_init(&ctx, key_len, key_local.b, + iv_local.b, iv_len); DCRYPTO_gcm_aad(&ctx, aad, aad_len); count = DCRYPTO_gcm_decrypt( &ctx, out_local.b, sizeof(out_local.b), @@ -437,7 +438,8 @@ static void aes_command_handler(void *cmd_body, size_t count; struct GCM_CTX ctx; - DCRYPTO_gcm_init(&ctx, key_local.b, iv_local.b, iv_len); + DCRYPTO_gcm_init(&ctx, key_len, key_local.b, + iv_local.b, iv_len); DCRYPTO_gcm_aad(&ctx, aad, aad_len); count = DCRYPTO_gcm_encrypt( &ctx, out_local.b, sizeof(out_local.b), |