@@ -145,5 +145,108 @@ match Invalid character in a string (1)
145145decode-pair 1a 01 7f
146146match Invalid character in a string (127)
147147
148+ #
149+ # ---- Boolean value errors ----
150+ #
151+
152+ #
153+ # Boolean with incorrect length (3 bytes instead of required 1)
154+ #
155+ proto-dictionary-root Test-Boolean
156+
157+ decode-pair 01 03 ff ff ff
158+ match Boolean has incorrect length (3). Must be 1.
159+
160+ #
161+ # Boolean with zero length
162+ #
163+ decode-pair 01 00
164+ match Boolean has incorrect length (0). Must be 1.
165+
166+ #
167+ # Boolean with non-DER value 0x01 (must be exactly 0x00 or 0xff)
168+ #
169+ decode-pair 01 01 01
170+ match Boolean is not correctly DER encoded (0x00 or 0xff).
171+
172+ #
173+ # Boolean with non-DER value 0x7f
174+ #
175+ decode-pair 01 01 7f
176+ match Boolean is not correctly DER encoded (0x00 or 0xff).
177+
178+ #
179+ # ---- Integer DER encoding errors ----
180+ #
181+
182+ #
183+ # Integer too large - 9 bytes exceeds maximum of 8 (sizeof uint64_t)
184+ #
185+ proto-dictionary-root Test-Integer
186+
187+ decode-pair 02 09 01 02 03 04 05 06 07 08 09
188+ match Integer too large (9)
189+
190+ #
191+ # Non-DER integer: unnecessary leading zero (0x00 0x01 should be just 0x01)
192+ #
193+ decode-pair 02 02 00 01
194+ match Integer is not correctly DER encoded. First two bytes are all 0s or all 1s.
195+
196+ #
197+ # Non-DER integer: unnecessary sign extension (0xff 0xfe should be just 0xfe)
198+ #
199+ decode-pair 02 02 ff fe
200+ match Integer is not correctly DER encoded. First two bytes are all 0s or all 1s.
201+
202+ #
203+ # ---- OID errors ----
204+ #
205+
206+ #
207+ # OID with truncated subidentifier - high bit set on last byte indicating
208+ # continuation, but no more data available
209+ #
210+ proto-dictionary-root Test-Oid
211+
212+ decode-pair 06 02 2b 88
213+ match OID subidentifier is truncated
214+
215+ #
216+ # ---- PrintableString character validation ----
217+ #
218+
219+ #
220+ # PrintableString with '@' (0x40=64) - not in allowed character set
221+ #
222+ proto-dictionary-root Test-String-Printable
223+
224+ decode-pair 13 01 40
225+ match Invalid character in a string (64)
226+
227+ #
228+ # PrintableString with '*' (0x2a=42) - not in allowed character set
229+ #
230+ decode-pair 13 01 2a
231+ match Invalid character in a string (42)
232+
233+ #
234+ # ---- Length field errors ----
235+ #
236+
237+ #
238+ # Multi-byte length field too large - 9 bytes of length exceeds max of 8
239+ #
240+ proto-dictionary-root Test-Boolean
241+
242+ decode-pair 01 89 01 02 03 04 05 06 07 08 09
243+ match Length field too large (9): Failed decoding Test-Boolean header
244+
245+ #
246+ # Insufficient data for declared length - header says 4 bytes but only 3 available
247+ #
248+ decode-pair 01 04 ff ff ff
249+ match Insufficient data for length field (4): Failed decoding Test-Boolean header
250+
148251count
149- match 43
252+ match 72
0 commit comments