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

Update to separate CMAC and AES conditional compiles. Correct update. #8007

Merged
merged 9 commits into from
Sep 25, 2024

Conversation

billphipps
Copy link
Contributor

Description

This provides a few cryptocb and CMAC updates:

  1. Correct cryptocb debug prints to correctly handle when NO_AES is defined
  2. Correct cryptocb CMAC update to NOT set devCtx to NULL
  3. Update CMAC to correctly support NO_AES and allow alternate crypto types
  4. Update internal usage to ensure NO_AES and WOLFSSL_CMAC are independent

Note that for proper functionality with AES CMAC, the defines WOLFSSL_CMAC, WOLFSSL_AES_DIRECT must be set, while NO_AES cannot be set. This matches current functionality.

Testing

  1. Numerous configurations with and without NO_AES using wolfHSM
  2. testwolfcrypt with --enable-all
  3. commit-tests.sh

Checklist

  • [ N/A ] added tests
  • [ N/A ] updated/added doxygen
  • [ N/A ] updated appropriate READMEs
  • [ N/A ] Updated manual and documentation

@billphipps billphipps changed the title Update to seperate CMAC and AES conditional compiles. Correct update. Update to separate CMAC and AES conditional compiles. Correct update. Sep 23, 2024
Copy link
Contributor

@bigbrett bigbrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved but consider adding compile error for non-AES enabled CMAC builds for now, unless that was deliberate to facilitate a cryptocb only approach.

wolfssl/wolfcrypt/cmac.h Show resolved Hide resolved
wolfssl/wolfcrypt/cmac.h Show resolved Hide resolved
@bigbrett bigbrett self-requested a review September 23, 2024 20:34
Copy link
Contributor

@bigbrett bigbrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI failing on clang-tidy


/tmp/workspace/PRB-multi-test-script/wolfssl/wolfcrypt/src/cmac.c:302:5: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores]
ret = 0;
^     ~
/tmp/workspace/PRB-multi-test-script/wolfssl/wolfcrypt/src/cmac.c:302:5: note: Value stored to 'ret' is never read
ret = 0;
^     ~

@billphipps billphipps assigned billphipps and dgarske and unassigned billphipps Sep 24, 2024
@bigbrett bigbrett self-requested a review September 24, 2024 19:45
bigbrett
bigbrett previously approved these changes Sep 24, 2024
wolfcrypt/src/cmac.c Show resolved Hide resolved
wolfcrypt/src/cryptocb.c Show resolved Hide resolved
wolfcrypt/src/cryptocb.c Outdated Show resolved Hide resolved
wolfcrypt/src/cmac.c Show resolved Hide resolved
Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice cleanups here. Just a minor item. Not required to fix, but it might improve things.

wolfssl/wolfcrypt/cmac.h Outdated Show resolved Hide resolved
@dgarske dgarske assigned billphipps and unassigned dgarske Sep 24, 2024
@philljj philljj self-requested a review September 25, 2024 03:17
@billphipps billphipps removed their assignment Sep 25, 2024
@bigbrett bigbrett merged commit 7592241 into wolfSSL:master Sep 25, 2024
137 checks passed
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.

5 participants