Uh oh!
There was an error while loading. Please reload this page.
mka: add WOLFMKA_ICV_L2_ADDR to include L2 addresses in the MKA ICV for wpa_supplicant interop - #2
Open
dgarske wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an optional build-time mode (WOLFMKA_ICV_L2_ADDR) that computes/verifies the MKPDU ICV over an IEEE 802.1X L2 prefix (DA || SA || EtherType) plus the EAPOL-MKA PDU, to improve interoperability with wpa_supplicant’s ICV input rules.
Changes:
- Add L2-prefix construction in the MKPDU encode/verify path when
WOLFMKA_ICV_L2_ADDRis enabled. - Introduce new crypto APIs (
wm_Crypto_IcvComputeL2/wm_Crypto_IcvVerifyL2) that stream CMAC over (L2 prefix + data) without a scratch buffer. - Export the new L2 ICV APIs in the public crypto header under the same build-time flag.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| mka/wolfMKA/src/mka_pdu.c | Conditionally builds an L2 prefix and uses L2-aware ICV compute/verify during encode/decode. |
| mka/wolfMKA/src/mka_crypto.c | Adds streaming CMAC helpers and public L2-inclusive ICV compute/verify functions. |
| mka/wolfMKA/include/wolfmka/mka_crypto.h | Declares the new L2-inclusive ICV APIs behind WOLFMKA_ICV_L2_ADDR. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+817
to
+818
| wm_Crypto_ForceZero(computed, sizeof computed); | ||
| return (diff == 0U) ? MKA_OK : MKA_ERR_ICV; |
Comment on lines
+766
to
+776
| ret = wc_InitCmac_ex(&ctx->cmac, key, (word32)key_len, WC_CMAC_AES, NULL, | ||
| WOLFMKA_HEAP_HINT, INVALID_DEVID); | ||
| if (ret == 0) { | ||
| ret = wc_CmacUpdate(&ctx->cmac, l2, (word32)l2_len); | ||
| } | ||
| if ((ret == 0) && (data_len > 0U)) { | ||
| ret = wc_CmacUpdate(&ctx->cmac, data, (word32)data_len); | ||
| } | ||
| if (ret == 0) { | ||
| ret = wc_CmacFinal(&ctx->cmac, mac, &out_sz); | ||
| } |
Comment on lines
+784
to
+789
| if ((cmac == NULL) || (l2 == NULL) || (data == NULL) || (icv == NULL)) { | ||
| return MKA_ERR_BAD_ARG; | ||
| } | ||
| if (!mka_key_valid(ick, ick_len)) { | ||
| return MKA_ERR_BAD_ARG; | ||
| } |
Comment on lines
+35
to
+39
| static const uint8_t pae_group[6] = { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x03 }; | ||
| (void)WOLFMKA_MEMCPY(&l2[0], pae_group, 6); | ||
| (void)WOLFMKA_MEMCPY(&l2[6], &eapol_pdu[8], 6); | ||
| l2[12] = 0x88; | ||
| l2[13] = 0x8E; |
Comment on lines
+780
to
+783
| MkaStatus wm_Crypto_IcvComputeL2(MkaCmacCtx* cmac, const uint8_t* ick, | ||
| size_t ick_len, const uint8_t* l2, size_t l2_len, const uint8_t* data, | ||
| size_t data_len, uint8_t icv[MKA_DEFAULT_ICV_LEN]) | ||
| { |
…or wpa_supplicant interop
dgarskeforce-pushed
the
macsec-mka-icv-l2-interop
branch
from
July 11, 2026 00:22
588ff43 to
5a1e251CompareSparkiDev
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.