Commit 2ada881
committed
RFC 9802: tighten ImportPubRaw_ex, doc fixes, more negative tests
Tightening
* wc_XmssKey_ImportPubRaw_ex now rejects an is_xmssmt hint that
contradicts a pre-set key->is_xmssmt with BAD_FUNC_ARG, instead
of silently ignoring it. The OID-only check that already exists
catches a wrong-numeric-OID case but cannot distinguish XMSS oid
1 from XMSS^MT oid 1.
* The MIN/MAX_HEIGHT compile-time guards in the auto-derive branch
now have explicit #else arms that document the dead-code path
(and silence -Wunused on the local oid).
Docs
* Update doxygen on wc_LmsKey_ImportPubRaw to describe the
auto-derive behaviour and its return codes.
* Update doxygen on wc_LmsKey_GetSigLen to mention the
key->params == NULL precondition.
* Cross-reference wc_XmssKey_ImportPubRaw_ex from the plain
wc_XmssKey_ImportPubRaw doxygen.
Tests
* New PARMSET-mismatch test for wc_XmssKey_ImportPubRaw_ex covers
both an OID-prefix mismatch and an is_xmssmt-hint mismatch
(locks in the new tightening).
* New partial-write invariant test for wc_LmsKey_ImportPubRaw
builds a buffer with valid type bytes but truncated length, and
asserts key->params is still NULL after the BUFFER_E return.
* rfc9802_load_file gains a named RFC9802_TEST_MAX_CERT_SIZE
constant, uses size_t for the XFREAD return compare, and the
junk[] buffer in rfc9802_xmss_import_negative is XMEMSET-zeroed
(project convention) instead of using {0}.
https://claude.ai/code/session_01SnSQMb145Hkyyf7hQQQ8cq1 parent 17b374c commit 2ada881
3 files changed
Lines changed: 86 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35807 | 35807 | | |
35808 | 35808 | | |
35809 | 35809 | | |
| 35810 | + | |
| 35811 | + | |
| 35812 | + | |
| 35813 | + | |
| 35814 | + | |
35810 | 35815 | | |
35811 | 35816 | | |
35812 | 35817 | | |
35813 | 35818 | | |
35814 | | - | |
35815 | | - | |
35816 | | - | |
| 35819 | + | |
| 35820 | + | |
| 35821 | + | |
| 35822 | + | |
35817 | 35823 | | |
35818 | 35824 | | |
35819 | 35825 | | |
| |||
35824 | 35830 | | |
35825 | 35831 | | |
35826 | 35832 | | |
35827 | | - | |
| 35833 | + | |
35828 | 35834 | | |
35829 | 35835 | | |
35830 | 35836 | | |
35831 | | - | |
| 35837 | + | |
| 35838 | + | |
35832 | 35839 | | |
35833 | 35840 | | |
35834 | 35841 | | |
| |||
35984 | 35991 | | |
35985 | 35992 | | |
35986 | 35993 | | |
| 35994 | + | |
| 35995 | + | |
| 35996 | + | |
| 35997 | + | |
| 35998 | + | |
| 35999 | + | |
| 36000 | + | |
| 36001 | + | |
| 36002 | + | |
| 36003 | + | |
| 36004 | + | |
| 36005 | + | |
| 36006 | + | |
| 36007 | + | |
| 36008 | + | |
| 36009 | + | |
| 36010 | + | |
| 36011 | + | |
| 36012 | + | |
35987 | 36013 | | |
35988 | 36014 | | |
35989 | 36015 | | |
| |||
35993 | 36019 | | |
35994 | 36020 | | |
35995 | 36021 | | |
35996 | | - | |
| 36022 | + | |
| 36023 | + | |
| 36024 | + | |
35997 | 36025 | | |
35998 | 36026 | | |
35999 | 36027 | | |
| |||
36029 | 36057 | | |
36030 | 36058 | | |
36031 | 36059 | | |
| 36060 | + | |
| 36061 | + | |
| 36062 | + | |
| 36063 | + | |
| 36064 | + | |
| 36065 | + | |
| 36066 | + | |
| 36067 | + | |
| 36068 | + | |
| 36069 | + | |
| 36070 | + | |
| 36071 | + | |
| 36072 | + | |
| 36073 | + | |
| 36074 | + | |
| 36075 | + | |
| 36076 | + | |
| 36077 | + | |
| 36078 | + | |
| 36079 | + | |
36032 | 36080 | | |
36033 | 36081 | | |
36034 | 36082 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1418 | 1418 | | |
1419 | 1419 | | |
1420 | 1420 | | |
1421 | | - | |
1422 | | - | |
1423 | | - | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
1424 | 1425 | | |
1425 | | - | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
1426 | 1432 | | |
1427 | 1433 | | |
1428 | 1434 | | |
1429 | 1435 | | |
1430 | 1436 | | |
1431 | | - | |
1432 | | - | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
1433 | 1443 | | |
1434 | 1444 | | |
1435 | 1445 | | |
| |||
1515 | 1525 | | |
1516 | 1526 | | |
1517 | 1527 | | |
1518 | | - | |
| 1528 | + | |
| 1529 | + | |
1519 | 1530 | | |
1520 | 1531 | | |
1521 | 1532 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1556 | 1556 | | |
1557 | 1557 | | |
1558 | 1558 | | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
1559 | 1562 | | |
1560 | 1563 | | |
1561 | 1564 | | |
| |||
1568 | 1571 | | |
1569 | 1572 | | |
1570 | 1573 | | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
1571 | 1577 | | |
1572 | 1578 | | |
1573 | 1579 | | |
| |||
1581 | 1587 | | |
1582 | 1588 | | |
1583 | 1589 | | |
1584 | | - | |
| 1590 | + | |
1585 | 1591 | | |
1586 | 1592 | | |
1587 | 1593 | | |
1588 | 1594 | | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
1589 | 1599 | | |
1590 | 1600 | | |
1591 | 1601 | | |
| |||
1612 | 1622 | | |
1613 | 1623 | | |
1614 | 1624 | | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
1615 | 1628 | | |
1616 | 1629 | | |
1617 | 1630 | | |
| |||
0 commit comments