Skip to content
Open
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
d3e12fd
F-17413 - Recognize attached private-only ECC keys
aidangarske Nov 23, 2026
dcf4312
F-13637 - Bound skipped recipient header maps
aidangarske Nov 23, 2026
73cf64a
F-17424 - Document empty direct recipient ciphertext
aidangarske Nov 23, 2026
804b6de
F-14972 - Size RSA prime export buffers for odd widths
aidangarske Nov 23, 2026
b35c16c
F-14973 - Validate skipped signature header maps
aidangarske Nov 23, 2026
605baf9
F-14974 - Forward tolerant decode flags to the HPKE ek header
aidangarske Nov 23, 2026
d3bb124
F-18398 - Report short HPKE recipient output as buffer too small
aidangarske Nov 23, 2026
79b7422
F-14994 - Reject duplicate labels in skipped header maps
aidangarske Nov 23, 2026
bab83c7
F-18434 - Remove invariant status guards in MAC, sign and encrypt paths
aidangarske Nov 23, 2026
896d3f8
F-14976 - Report a truncated PSA components claim as malformed
aidangarske Nov 23, 2026
dae5f33
F-14995 - Accept an empty protected map for AES Key Wrap recipients
aidangarske Nov 23, 2026
80f0faf
F-17461 - Bound the PSA prior-label scan by its counter and status only
aidangarske Nov 23, 2026
c683e53
F-17462 - Document the status-guarded loop deviation and prove each l…
aidangarske Nov 24, 2026
cb681ca
F-15038 - Convert container bounds to uint64_t from size_t locals
aidangarske Nov 24, 2026
2e70142
F-17463 - Convert the head length bound to uint64_t from a size_t local
aidangarske Nov 24, 2026
fe405b5
F-17464 - Convert the text label length room to uint64_t from a size_…
aidangarske Nov 24, 2026
030fa2c
F-17465 - Convert the countersignature list count from a size_t local
aidangarske Nov 24, 2026
cff1852
F-17466 - Cast wolfCrypt curve enumerators to int explicitly
aidangarske Nov 24, 2026
69a8a5d
F-17467 - Cast the HPKE ephemeral curve enumerator to int
aidangarske Nov 24, 2026
5f44f28
F-17468 - Pass the COSE_Mac recipient count as size_t
aidangarske Nov 24, 2026
952566a
F-17469 - Pass the COSE_Encrypt recipient count as size_t
aidangarske Nov 24, 2026
66e0727
F-18437 - Drop dead status initializers in header and PSA encoders
aidangarske Nov 24, 2026
349eaff
F-18399 - Report an empty signatures or recipients array as malformed
aidangarske Nov 24, 2026
10c81cf
F-18475 - Reject a detached payload when the message carries its own
aidangarske Nov 24, 2026
45f5aa9
F-17445 - Require detached firmware manifests
aidangarske Nov 23, 2026
2456a6c
F-18473 - Reject a detached payload for a countersignature target wit…
aidangarske Nov 24, 2026
6849cd2
F-14977 - Require an attached ECC key for ECDSA countersignature verify
aidangarske Nov 24, 2026
976fe04
F-14978 - Require matching attached keys for local countersignature s…
aidangarske Nov 24, 2026
141f94e
F-14980 - Require an attached ECC key for local ECDSA signing
aidangarske Nov 24, 2026
c59e6e6
F-15104 - Require a symmetric or empty attachment before using symmet…
aidangarske Nov 24, 2026
e2e673d
F-14979 - Require the matching key attachment in COSE_Key encode and …
aidangarske Nov 24, 2026
26d6c20
F-17509 - Scrub HMAC contexts after every COSE_Mac0 and COSE_Mac oper…
aidangarske Nov 24, 2026
6ac260b
F-17516 - Derive ECDH-ES content keys through a wiped HKDF PRK
aidangarske Nov 24, 2026
5312ded
F-17517 - Wrap and unwrap content keys with a local, wiped AES context
aidangarske Nov 24, 2026
98becca
F-17495 - Count each expected content key wipe in the ECDH-ES zeroize…
aidangarske Nov 24, 2026
140d8d4
F-18429 - Leave the CBOR cursor unchanged when a public encode or dec…
aidangarske Nov 24, 2026
b57eba1
F-18474 - Bind the resolver-selected UEID to the authenticated PSA token
aidangarske Nov 24, 2026
0ab7ef2
F-18461 - Report an oversized HPKE-0-KE recipient kid as an argument …
aidangarske Nov 24, 2026
4410e4f
F-17471 - Initialize library context and profile byte arrays from hex…
aidangarske Nov 24, 2026
8cc5a44
F-15047 - Document the PSA overlap address comparison deviation
aidangarske Nov 24, 2026
7f09dd2
F-15048 - View PSA claim objects as unsigned char bytes in the overla…
aidangarske Nov 24, 2026
8cdc497
F-15049 - View the countersignature header as unsigned char bytes in …
aidangarske Nov 24, 2026
8f01f04
F-17460 - Document the GNU asm zeroization barrier as a Rule 1.2 devi…
aidangarske Nov 24, 2026
5c9a1b4
F-15050 - Require IEEE 754 binary32 and binary64 for the CBOR float e…
aidangarske Nov 24, 2026
205016a
F-15112 - Wipe cached ML-DSA private vectors before wolfCrypt resets …
aidangarske Nov 24, 2026
6ed1dad
F-18397 - Encode a private-only EC2 key as kty, crv and d
aidangarske Nov 24, 2026
591eabd
F-18425 - Read an ECDH-ES ephemeral key from the recipient protected …
aidangarske Nov 24, 2026
9edeebc
F-15043 - Copy const inputs into mutable buffers for non-const wolfCr…
aidangarske Nov 24, 2026
c7d7110
F-15045 - Give the test hook and curve-gate check visible declarations
aidangarske Nov 24, 2026
798d54d
F-18439 - Document text literals in example byte arrays and guard the…
aidangarske Nov 24, 2026
aa39b34
F-18476 - Reject a verify scratch buffer that overlaps its message or…
aidangarske Nov 24, 2026
0dc2d38
F-15103 - Reject a create or decrypt scratch buffer that overlaps an …
aidangarske Nov 24, 2026
fc577b2
F-14996 - Run the content cipher after a failed HPKE-0-KE recipient open
aidangarske Nov 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
F-15038 - Convert container bounds to uint64_t from size_t locals
  • Loading branch information
aidangarske committed Nov 30, 2026
commit cb681ca9aae348b4e558b50ef60bcda7ef061c31
8 changes: 5 additions & 3 deletions src/wolfcose_cbor.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,17 +720,19 @@ static int wolfCose_CBOR_DecodeContainerStart_ex(WOLFCOSE_CBOR_CTX* ctx,
else {
ret = wolfCose_CBOR_DecodeHead_ex(ctx, &item, decodeFlags);
if (ret == WOLFCOSE_SUCCESS) {
size_t remaining = ctx->bufSz - ctx->idx;
size_t pairRoom = remaining / 2u;

if (item.majorType != majorType) {
ret = WOLFCOSE_E_CBOR_TYPE;
}
/* An array needs at least one byte per item, and a map needs at
* least two bytes per pair. These checks also reject counts that
* would not fit in size_t. */
else if (((majorType == WOLFCOSE_CBOR_ARRAY) &&
(item.val > (uint64_t)(ctx->bufSz - ctx->idx))) ||
(item.val > (uint64_t)remaining)) ||
((majorType == WOLFCOSE_CBOR_MAP) &&
(item.val >
(uint64_t)((ctx->bufSz - ctx->idx) / 2u)))) {
(item.val > (uint64_t)pairRoom))) {
ret = WOLFCOSE_E_CBOR_MALFORMED;
}
else {
Expand Down