Commit 4e1a7d4
authored
CMAC refactor + deprecate cancellation (#279)
* WIP: CMAC state refactor. Passing tests and wolfCrypt tests. About to rip out cancellation
* remove cancellation API
* - refactor non-dma oneshot cmac generate to support cached keys
- refactor DMA CMAC to use client-supplied state vs state by reference
- refactor to use stack allocated CMAC context
- expand CMAC tests to mimic wolfCrypt tests but with cached keys
- housekeeping, error checking
* Review feedback:
- Reserve removed error codes (wh_error.h): WH_ERROR_RESERVED{1,2}
- Reserve removed message group (wh_message.h): WH_MESSAGE_GROUP_RESERVED
- Rename CMAC → CmacAes (wh_message_crypto.h, all consumers): All structs and translation functions renamed to indicate AES-specific
- Remove `type` field from request structs and translation; use WC_CMAC_AES literal on server
- Remove switch(req.type) in server handlers; guard with #if defined(WOLFSSL_CMAC) && !defined(NO_AES) && defined(WOLFSSL_AES_DIRECT) instead
- Extract _CmacResolveKey() static helper for shared key resolution (inline key or keystore + usage policy + size validation)
- Extract wh_Crypto_CmacAesSaveStateToMsg() / RestoreStateFromMsg() to deduplicate state pack/unpack across client + server + DMA
- BAD_FUNC_ARG → WH_ERROR_BADARGS for bufferSz validation (now inside RestoreStateFromMsg)
- Don't read req.* after response may overlap — use WC_CMAC_AES literal instead of req.type
- #define/#undef → enum for CMAC_MLEN_* test constants1 parent 062a005 commit 4e1a7d4
File tree
17 files changed
+776
-1333
lines changed- src
- test
- config
- wolfhsm
17 files changed
+776
-1333
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | 79 | | |
84 | 80 | | |
85 | 81 | | |
| |||
472 | 468 | | |
473 | 469 | | |
474 | 470 | | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | 471 | | |
543 | 472 | | |
544 | 473 | | |
| |||
0 commit comments