Skip to content

Commit

Permalink
u2f: Fix leaking message digest contexts (#4052)
Browse files Browse the repository at this point in the history
* u2f: Fix leaking message digest contexts
* Github: fix doxygen version to 1.12

Co-authored-by: あく <[email protected]>
  • Loading branch information
GMMan and skotopes authored Jan 10, 2025
1 parent 668500e commit 5efdab8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE"
- name: 'Generate documentation'
uses: mattnotmitt/doxygen-action@edge
uses: mattnotmitt/doxygen-action@1.12.0
env:
DOXY_SRC_ROOT: "${{ github.workspace }}"
DOXY_CONFIG_DIR: "${{ github.workspace }}/documentation/doxygen"
Expand Down
4 changes: 4 additions & 0 deletions applications/main/u2f/u2f.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ static uint16_t u2f_register(U2fData* U2F, uint8_t* buf) {
MCHECK(mbedtls_md_hmac_update(&hmac_ctx, private, sizeof(private)));
MCHECK(mbedtls_md_hmac_update(&hmac_ctx, req->app_id, sizeof(req->app_id)));
MCHECK(mbedtls_md_hmac_finish(&hmac_ctx, handle.hash));

mbedtls_md_free(&hmac_ctx);
}

// Generate public key
Expand Down Expand Up @@ -387,6 +389,8 @@ static uint16_t u2f_authenticate(U2fData* U2F, uint8_t* buf) {
MCHECK(mbedtls_md_hmac_update(&hmac_ctx, priv_key, sizeof(priv_key)));
MCHECK(mbedtls_md_hmac_update(&hmac_ctx, req->app_id, sizeof(req->app_id)));
MCHECK(mbedtls_md_hmac_finish(&hmac_ctx, mac_control));

mbedtls_md_free(&hmac_ctx);
}

if(memcmp(req->key_handle.hash, mac_control, sizeof(mac_control)) != 0) {
Expand Down

0 comments on commit 5efdab8

Please sign in to comment.