-
Notifications
You must be signed in to change notification settings - Fork 32
Fix fenrir findings across wolfProvider #387
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
base: master
Are you sure you want to change the base?
Changes from all commits
6e8bb19
a0fedc3
d3d620d
eba09b8
1ebe98a
4aeb35e
1d0fb43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -91,7 +91,7 @@ static void wp_cmac_free(wp_CmacCtx* macCtx) | |||||||||||||||||||||||
| { | ||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. finding 3
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. finding 3 body
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 [Medium] CMAC free does not call wc_CmacFree unlike GMAC's wc_AesFree addition The PR correctly added Suggestion:
Suggested change
|
||||||||||||||||||||||||
| if (macCtx != NULL) { | ||||||||||||||||||||||||
| OPENSSL_cleanse(macCtx->key, macCtx->keyLen); | ||||||||||||||||||||||||
| OPENSSL_free(macCtx); | ||||||||||||||||||||||||
| OPENSSL_clear_free(macCtx, sizeof(*macCtx)); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
@@ -222,14 +222,19 @@ static int wp_cmac_update(wp_CmacCtx* macCtx, const unsigned char* data, | |||||||||||||||||||||||
| size_t dataLen) | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| int ok = 1; | ||||||||||||||||||||||||
| int rc; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| WOLFPROV_ENTER(WP_LOG_COMP_MAC, "wp_cmac_update"); | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| rc = wc_CmacUpdate(&macCtx->cmac, data, (word32)dataLen); | ||||||||||||||||||||||||
| if (rc != 0) { | ||||||||||||||||||||||||
| WOLFPROV_MSG_DEBUG_RETCODE(WP_LOG_LEVEL_DEBUG, "wc_CmacUpdate", rc); | ||||||||||||||||||||||||
| ok = 0; | ||||||||||||||||||||||||
| while (ok && (dataLen > 0)) { | ||||||||||||||||||||||||
| word32 chunk = (dataLen > 0xFFFFFFFFU) ? 0xFFFFFFFFU : (word32)dataLen; | ||||||||||||||||||||||||
| int rc = wc_CmacUpdate(&macCtx->cmac, data, chunk); | ||||||||||||||||||||||||
| if (rc != 0) { | ||||||||||||||||||||||||
| WOLFPROV_MSG_DEBUG_RETCODE(WP_LOG_LEVEL_DEBUG, "wc_CmacUpdate", | ||||||||||||||||||||||||
| rc); | ||||||||||||||||||||||||
| ok = 0; | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| data += chunk; | ||||||||||||||||||||||||
| dataLen -= chunk; | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| WOLFPROV_LEAVE(WP_LOG_COMP_MAC, __FILE__ ":" WOLFPROV_STRINGIZE(__LINE__), ok); | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test inline