Repository navigation
Commit 5b5a6fd
committed
Sweep every registered algorithm for signature-buffer bounds
The buffer-bounds group in test_security_audit.c named eleven algorithms
explicitly, which is the same weakness that let the SNOVA and CROSS
overflow through in the first place: test_sig_all.c already allocates
calloc(1, max_signature_size()) and signs into it, exactly the shape
that catches this, but the affected schemes sat outside its allow list.
The underlying problem is that one list was gating two different
expectations. Round-tripping is a correctness property that several
algorithms here legitimately fail today. Staying inside
max_signature_size() is a memory-safety property that every registered
algorithm owes its caller whether or not it is otherwise correct, so it
must not be gated on brokenness.
The sweep now enumerates pqc_sig_algorithm_count() rather than a fixed
list: 54 algorithms considered, 47 signed, 93 checks in that group where
there were 22. The suite reports 125 checks in total. Remaining skips are
for key-generation cost only -- XMSS-16/20 and LMS-H15/20/25 rebuild a
2^h-leaf tree per key, and XMSS-20 does not finish at all -- and the code
says so rather than implying the algorithm is at fault. A newly added
scheme is now covered for memory safety automatically, while still broken.
Enumerating everything immediately found a second defect. Stateful
schemes leave .sign NULL and are signed through pqc_sig_sign_stateful(),
but pqc_sig_sign() never checked, so calling the stateless entry point on
LMS or XMSS dereferenced a NULL function pointer. No test had done that
before. It now returns PQC_ERROR_NOT_SUPPORTED.
The allow-list observation is Conner's; both fixes above follow from it.
Reported-by: Conner (Spartan8806) <https://github.com/spartan8806>1 parent f9c2892 commit 5b5a6fd
2 files changed
Lines changed: 59 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
140 | 148 | | |
141 | 149 | | |
142 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
45 | 70 | | |
46 | 71 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | 72 | | |
56 | | - | |
| 73 | + | |
57 | 74 | | |
58 | 75 | | |
| 76 | + | |
59 | 77 | | |
60 | | - | |
61 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
62 | 81 | | |
63 | 82 | | |
64 | 83 | | |
| |||
68 | 87 | | |
69 | 88 | | |
70 | 89 | | |
71 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
72 | 98 | | |
73 | 99 | | |
74 | 100 | | |
75 | 101 | | |
76 | 102 | | |
77 | | - | |
| 103 | + | |
78 | 104 | | |
79 | 105 | | |
80 | 106 | | |
81 | 107 | | |
82 | 108 | | |
83 | 109 | | |
84 | 110 | | |
85 | | - | |
| 111 | + | |
86 | 112 | | |
87 | 113 | | |
88 | 114 | | |
89 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
90 | 122 | | |
91 | 123 | | |
92 | 124 | | |
93 | 125 | | |
94 | 126 | | |
95 | 127 | | |
96 | | - | |
| 128 | + | |
97 | 129 | | |
98 | 130 | | |
99 | 131 | | |
100 | 132 | | |
101 | 133 | | |
102 | | - | |
| 134 | + | |
103 | 135 | | |
104 | 136 | | |
105 | 137 | | |
106 | 138 | | |
107 | 139 | | |
108 | 140 | | |
| 141 | + | |
| 142 | + | |
109 | 143 | | |
110 | 144 | | |
111 | 145 | | |
| |||
0 commit comments