Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 1 | Empty length |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 2 | parse_prefixes:"04":MBEDTLS_ERR_ASN1_OUT_OF_DATA:UNPREDICTABLE_RESULT |
| 3 | |
| 4 | Incomplete length |
| 5 | parse_prefixes:"0481":MBEDTLS_ERR_ASN1_OUT_OF_DATA:UNPREDICTABLE_RESULT |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 6 | |
| 7 | Prefixes of OCTET STRING, length=0 |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 8 | parse_prefixes:"0400":0:0 |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 9 | |
| 10 | Prefixes of OCTET STRING, length=0 (0 length bytes) |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 11 | parse_prefixes:"0480":MBEDTLS_ERR_ASN1_INVALID_LENGTH:MBEDTLS_ERR_ASN1_INVALID_LENGTH |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 12 | |
| 13 | Prefixes of OCTET STRING, length=1 |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 14 | parse_prefixes:"040141":0:0 |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 15 | |
| 16 | Prefixes of OCTET STRING, length=2 |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 17 | parse_prefixes:"04024142":0:0 |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 18 | |
| 19 | Prefixes of BOOLEAN, length=0 |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 20 | parse_prefixes:"0100":MBEDTLS_ERR_ASN1_INVALID_LENGTH:MBEDTLS_ERR_ASN1_INVALID_LENGTH |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 21 | |
| 22 | Prefixes of BOOLEAN, length=1 |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 23 | parse_prefixes:"010100":0:0 |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 24 | |
| 25 | Prefixes of BOOLEAN, length=2 |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 26 | parse_prefixes:"01020000":MBEDTLS_ERR_ASN1_INVALID_LENGTH:MBEDTLS_ERR_ASN1_INVALID_LENGTH |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 27 | |
| 28 | Prefixes of INTEGER, length=1 |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 29 | parse_prefixes:"020141":0:0 |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 30 | |
| 31 | Prefixes of INTEGER, length=2 |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 32 | parse_prefixes:"02024142":0:0 |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 33 | |
| 34 | Prefixes of INTEGER, length=5 |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 35 | parse_prefixes:"02054142434445":0:0 |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 36 | |
| 37 | Prefixes of empty BIT STRING |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 38 | parse_prefixes:"0300":MBEDTLS_ERR_ASN1_OUT_OF_DATA:UNPREDICTABLE_RESULT |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 39 | |
| 40 | Prefixes of BIT STRING, unused_bits=0, payload_length=0 |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 41 | parse_prefixes:"030100":0:MBEDTLS_ERR_ASN1_LENGTH_MISMATCH |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 42 | |
| 43 | Prefixes of BIT STRING, unused_bits=0, payload_length=1 |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 44 | parse_prefixes:"0302002a":0:MBEDTLS_ERR_ASN1_LENGTH_MISMATCH |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 45 | |
| 46 | Prefixes of BIT STRING, unused_bits=1, payload_length=1 |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 47 | parse_prefixes:"0302012a":0:MBEDTLS_ERR_ASN1_LENGTH_MISMATCH |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 48 | |
| 49 | Prefixes of empty SEQUENCE |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 50 | parse_prefixes:"3000":0:0 |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 51 | |
| 52 | Prefixes of SEQUENCE of BOOLEAN, INTEGER, INTEGER |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 53 | parse_prefixes:"300b01010102012a0203123456":0:0 |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 54 | |
| 55 | Prefixes of SEQUENCE of (SEQUENCE of INTEGER, INTEGER), INTEGER |
Gilles Peskine | 95c893d | 2020-01-21 21:26:36 +0100 | [diff] [blame] | 56 | parse_prefixes:"300b3006020141020142020161":0:0 |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 57 | |
| 58 | length=0 (short form) |
| 59 | get_len:"00":0 |
| 60 | |
| 61 | length=0 (1 length byte) |
| 62 | get_len:"8100":0 |
| 63 | |
| 64 | length=0 (2 length bytes) |
| 65 | get_len:"820000":0 |
| 66 | |
| 67 | length=1 (short form) |
| 68 | get_len:"01":1 |
| 69 | |
| 70 | length=1 (1 length byte) |
| 71 | get_len:"8101":1 |
| 72 | |
| 73 | length=1 (2 length bytes) |
| 74 | get_len:"820001":1 |
| 75 | |
| 76 | length=1 (3 length bytes) |
| 77 | get_len:"83000001":1 |
| 78 | |
| 79 | length=1 (4 length bytes) |
| 80 | get_len:"8400000001":1 |
| 81 | |
| 82 | length=2 (short form) |
| 83 | get_len:"02":2 |
| 84 | |
| 85 | length=2 (1 length byte) |
| 86 | get_len:"8102":2 |
| 87 | |
| 88 | length=2 (2 length bytes) |
| 89 | get_len:"820002":2 |
| 90 | |
| 91 | length=2 (3 length bytes) |
| 92 | get_len:"83000002":2 |
| 93 | |
| 94 | length=2 (4 length bytes) |
| 95 | get_len:"8400000002":2 |
| 96 | |
| 97 | length=127 (short form) |
| 98 | get_len:"7f":127 |
| 99 | |
| 100 | length=128 (1 length byte) |
| 101 | get_len:"8180":128 |
| 102 | |
| 103 | length=128 (2 length bytes) |
| 104 | get_len:"820080":128 |
| 105 | |
| 106 | length=255 (1 length byte) |
| 107 | get_len:"81ff":255 |
| 108 | |
| 109 | length=255 (2 length bytes) |
| 110 | get_len:"8200ff":255 |
| 111 | |
| 112 | length=256 (2 length bytes) |
| 113 | get_len:"820100":256 |
| 114 | |
| 115 | length=256 (3 length bytes) |
| 116 | get_len:"83000100":256 |
| 117 | |
| 118 | length=258 (2 length bytes) |
| 119 | get_len:"820102":258 |
| 120 | |
| 121 | length=258 (3 length bytes) |
| 122 | get_len:"83000102":258 |
| 123 | |
| 124 | length=65535 (2 length bytes) |
| 125 | get_len:"82ffff":65535 |
| 126 | |
| 127 | length=65535 (3 length bytes) |
| 128 | get_len:"8300ffff":65535 |
| 129 | |
| 130 | length=65535 (4 length bytes) |
| 131 | get_len:"840000ffff":65535 |
| 132 | |
| 133 | length=65536 (3 length bytes) |
| 134 | get_len:"83010000":65536 |
| 135 | |
| 136 | length=65536 (4 length bytes) |
| 137 | get_len:"8400010000":65536 |
| 138 | |
| 139 | length=16777215 (3 length bytes) |
| 140 | get_len:"83ffffff":16777215 |
| 141 | |
| 142 | length=16777215 (4 length bytes) |
| 143 | get_len:"8400ffffff":16777215 |
| 144 | |
| 145 | length=16777216 (4 length bytes) |
| 146 | get_len:"8401000000":16777216 |
| 147 | |
| 148 | length=16909060 (4 length bytes) |
| 149 | get_len:"8401020304":16909060 |
| 150 | |
| 151 | BOOLEAN FALSE |
| 152 | get_boolean:"010100":0:0 |
| 153 | |
| 154 | BOOLEAN TRUE (1) |
| 155 | get_boolean:"010101":1:0 |
| 156 | |
| 157 | BOOLEAN TRUE (2) |
| 158 | get_boolean:"010101":1:0 |
| 159 | |
| 160 | BOOLEAN TRUE (128) |
| 161 | get_boolean:"010180":1:0 |
| 162 | |
| 163 | BOOLEAN TRUE (255) |
| 164 | get_boolean:"0101ff":1:0 |
| 165 | |
| 166 | Not BOOLEAN |
| 167 | get_boolean:"020101":0:MBEDTLS_ERR_ASN1_UNEXPECTED_TAG |
| 168 | |
| 169 | Empty INTEGER |
Gilles Peskine | 321adb2 | 2019-10-10 19:18:21 +0200 | [diff] [blame] | 170 | empty_integer:"0200" |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 171 | |
| 172 | INTEGER 0 |
| 173 | get_integer:"020100":"0":0 |
| 174 | |
| 175 | INTEGER 0, extra leading 0 |
| 176 | get_integer:"02020000":"0":0 |
| 177 | |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 178 | INTEGER 1 |
| 179 | get_integer:"020101":"1":0: |
| 180 | |
| 181 | INTEGER 1, extra leading 0 |
| 182 | get_integer:"02020001":"1":0: |
| 183 | |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 184 | INTEGER 0x7f |
| 185 | get_integer:"02017f":"7f":0 |
| 186 | |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 187 | INTEGER 0x80 |
| 188 | get_integer:"02020080":"80":0 |
| 189 | |
| 190 | INTEGER 0x80, extra leading 0 |
| 191 | get_integer:"0203000080":"80":0 |
| 192 | |
| 193 | INTEGER 0xff |
| 194 | get_integer:"020200ff":"ff":0 |
| 195 | |
| 196 | INTEGER 0x7fff |
| 197 | get_integer:"02027fff":"7fff":0 |
| 198 | |
| 199 | INTEGER 0x12345678 |
| 200 | get_integer:"020412345678":"12345678":0 |
| 201 | |
| 202 | INTEGER 0x12345678, extra leading 0 |
| 203 | get_integer:"02050012345678":"12345678":0 |
| 204 | |
Gilles Peskine | 0370b1b | 2019-10-10 19:25:39 +0200 | [diff] [blame] | 205 | INTEGER 0x7fffffff |
| 206 | get_integer:"02047fffffff":"7fffffff":0 |
| 207 | |
| 208 | INTEGER 0x7fffffff, extra leading 0 |
| 209 | get_integer:"0205007fffffff":"7fffffff":0 |
| 210 | |
| 211 | INTEGER 0x80000000 |
| 212 | get_integer:"02050080000000":"80000000":0 |
| 213 | |
| 214 | INTEGER 0xffffffff |
| 215 | get_integer:"020500ffffffff":"ffffffff":0 |
| 216 | |
| 217 | INTEGER 0x100000000 |
| 218 | get_integer:"02050100000000":"0100000000":0 |
| 219 | |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 220 | INTEGER 0x123456789abcdef0 |
| 221 | get_integer:"0208123456789abcdef0":"123456789abcdef0":0 |
| 222 | |
Gilles Peskine | 0370b1b | 2019-10-10 19:25:39 +0200 | [diff] [blame] | 223 | INTEGER 0xfedcab9876543210 |
| 224 | get_integer:"020900fedcab9876543210":"fedcab9876543210":0 |
| 225 | |
| 226 | INTEGER 0x1fedcab9876543210 |
| 227 | get_integer:"020901fedcab9876543210":"1fedcab9876543210":0 |
| 228 | |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 229 | INTEGER with 127 value octets |
| 230 | get_integer:"027f0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd":0 |
| 231 | |
| 232 | INTEGER with 127 value octets (long length encoding) |
| 233 | get_integer:"02817f0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd":0 |
| 234 | |
| 235 | INTEGER with 128 value octets |
| 236 | get_integer:"0281800123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef":0 |
| 237 | |
| 238 | INTEGER with 128 value octets (leading 0 in length) |
| 239 | get_integer:"028200800123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef":0 |
| 240 | |
Gilles Peskine | 970dcbf | 2019-10-10 19:21:12 +0200 | [diff] [blame] | 241 | INTEGER -1 |
| 242 | get_integer:"0201ff":"-1":0 |
| 243 | |
Gilles Peskine | 0370b1b | 2019-10-10 19:25:39 +0200 | [diff] [blame] | 244 | INTEGER -1, extra leading ff |
| 245 | get_integer:"0202ffff":"-1":0 |
| 246 | |
Gilles Peskine | 970dcbf | 2019-10-10 19:21:12 +0200 | [diff] [blame] | 247 | INTEGER -0x7f |
| 248 | get_integer:"020181":"-7f":0 |
| 249 | |
Gilles Peskine | 0370b1b | 2019-10-10 19:25:39 +0200 | [diff] [blame] | 250 | INTEGER -0x80 |
| 251 | get_integer:"020180":"-80":0 |
| 252 | |
| 253 | INTEGER -0x81 |
| 254 | get_integer:"0202ff7f":"-81":0 |
| 255 | |
| 256 | INTEGER -0xff |
| 257 | get_integer:"0202ff01":"-ff":0 |
| 258 | |
| 259 | INTEGER -0x100 |
| 260 | get_integer:"0202ff00":"-100":0 |
| 261 | |
| 262 | INTEGER -0x7fffffff |
| 263 | get_integer:"020480000001":"-7fffffff":0 |
| 264 | |
| 265 | INTEGER -0x80000000 |
| 266 | get_integer:"020480000000":"-80000000":0 |
| 267 | |
| 268 | INTEGER -0x80000001 |
| 269 | get_integer:"0205ff7fffffff":"-80000001":0 |
| 270 | |
| 271 | INTEGER -0xffffffff |
| 272 | get_integer:"0205ff00000001":"-ffffffff":0 |
| 273 | |
| 274 | INTEGER -0x100000000 |
| 275 | get_integer:"0205ff00000000":"-100000000":0 |
| 276 | |
| 277 | INTEGER -0x123456789abcdef0 |
| 278 | get_integer:"0208edcba98765432110":"-123456789abcdef0":0 |
| 279 | |
| 280 | INTEGER -0xfedcba9876543210 |
| 281 | get_integer:"0209ff0123456789abcdf0":"-fedcba9876543210":0 |
| 282 | |
| 283 | INTEGER -0x1fedcab9876543210 |
| 284 | get_integer:"0209fe0123546789abcdf0":"-1fedcab9876543210":0 |
| 285 | |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 286 | Not INTEGER |
| 287 | get_integer:"010101":"":MBEDTLS_ERR_ASN1_UNEXPECTED_TAG |
| 288 | |
| 289 | INTEGER too large for mpi |
| 290 | get_mpi_too_large: |
| 291 | |
Mykhailo Sopiha | 6af7bf9 | 2019-10-31 15:55:16 +0200 | [diff] [blame] | 292 | ENUMERATED 0 |
| 293 | get_enum:"0A0100":"0":0 |
| 294 | |
| 295 | ENUMERATED 0, extra leading 0 |
| 296 | get_enum:"0A020000":"0":0 |
| 297 | |
| 298 | ENUMERATED 1 |
| 299 | get_enum:"0A0101":"1":0 |
| 300 | |
| 301 | ENUMERATED 1, extra leading 0 |
| 302 | get_enum:"0A020001":"1":0 |
| 303 | |
| 304 | ENUMERATED 0x7f |
| 305 | get_enum:"0A017f":"7f":0 |
| 306 | |
| 307 | ENUMERATED 0x80 |
| 308 | get_enum:"0A020080":"80":0 |
| 309 | |
| 310 | ENUMERATED 0x80, extra leading 0 |
| 311 | get_enum:"0A03000080":"80":0 |
| 312 | |
| 313 | ENUMERATED 0xff |
| 314 | get_enum:"0A0200ff":"ff":0 |
| 315 | |
| 316 | ENUMERATED 0x7fff |
| 317 | get_enum:"0A027fff":"7fff":0 |
| 318 | |
| 319 | ENUMERATED 0x12345678 |
| 320 | get_enum:"0A0412345678":"12345678":0 |
| 321 | |
| 322 | ENUMERATED 0x12345678, extra leading 0 |
| 323 | get_enum:"0A050012345678":"12345678":0 |
| 324 | |
| 325 | ENUMERATED 0x7fffffff |
| 326 | get_enum:"0A047fffffff":"7fffffff":0 |
| 327 | |
| 328 | ENUMERATED 0x7fffffff, extra leading 0 |
| 329 | get_enum:"0A05007fffffff":"7fffffff":0 |
| 330 | |
| 331 | ENUMERATED 0x80000000 |
| 332 | get_enum:"0A050080000000":"80000000":0 |
| 333 | |
| 334 | ENUMERATED 0xffffffff |
| 335 | get_enum:"0A0500ffffffff":"ffffffff":0 |
| 336 | |
| 337 | ENUMERATED 0x100000000 |
| 338 | get_enum:"0A050100000000":"0100000000":0 |
| 339 | |
| 340 | ENUMERATED -1 |
| 341 | get_enum:"0A01ff":"-1":0 |
| 342 | |
| 343 | ENUMERATED -1, extra leading ff |
| 344 | get_enum:"0A02ffff":"-1":0 |
| 345 | |
| 346 | ENUMERATED -0x7f |
| 347 | get_enum:"0A0181":"-7f":0 |
| 348 | |
| 349 | ENUMERATED -0x80 |
| 350 | get_enum:"0A0180":"-80":0 |
| 351 | |
| 352 | ENUMERATED -0x81 |
| 353 | get_enum:"0A02ff7f":"-81":0 |
| 354 | |
| 355 | ENUMERATED -0xff |
| 356 | get_enum:"0A02ff01":"-ff":0 |
| 357 | |
| 358 | ENUMERATED -0x100 |
| 359 | get_enum:"0A02ff00":"-100":0 |
| 360 | |
| 361 | ENUMERATED -0x7fffffff |
| 362 | get_enum:"0A0480000001":"-7fffffff":0 |
| 363 | |
| 364 | ENUMERATED -0x80000000 |
| 365 | get_enum:"0A0480000000":"-80000000":0 |
| 366 | |
| 367 | ENUMERATED -0x80000001 |
| 368 | get_enum:"0A05ff7fffffff":"-80000001":0 |
| 369 | |
| 370 | ENUMERATED -0xffffffff |
| 371 | get_enum:"0A05ff00000001":"-ffffffff":0 |
| 372 | |
| 373 | ENUMERATED -0x100000000 |
| 374 | get_enum:"0A05ff00000000":"-100000000":0 |
| 375 | |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 376 | BIT STRING: empty |
| 377 | get_bitstring:"0300":0:0:MBEDTLS_ERR_ASN1_OUT_OF_DATA:MBEDTLS_ERR_ASN1_INVALID_DATA |
| 378 | |
| 379 | BIT STRING: octets=0, unused_bits=0 |
| 380 | get_bitstring:"030100":0:0:0:0 |
| 381 | |
| 382 | BIT STRING: octets=0, unused_bits=7 |
| 383 | get_bitstring:"030107":0:7:0:MBEDTLS_ERR_ASN1_INVALID_DATA |
| 384 | |
| 385 | BIT STRING: octets=0, unused_bits=8 |
| 386 | get_bitstring:"030108":0:0:MBEDTLS_ERR_ASN1_INVALID_LENGTH:MBEDTLS_ERR_ASN1_INVALID_DATA |
| 387 | |
| 388 | BIT STRING: octets=1, unused_bits=0 |
| 389 | get_bitstring:"03020041":1:0:0:0 |
| 390 | |
| 391 | BIT STRING: octets=1, unused_bits=7 |
| 392 | get_bitstring:"03020741":1:7:0:MBEDTLS_ERR_ASN1_INVALID_DATA |
| 393 | |
| 394 | BIT STRING: octets=1, unused_bits=8 |
| 395 | get_bitstring:"03020841":1:8:MBEDTLS_ERR_ASN1_INVALID_LENGTH:MBEDTLS_ERR_ASN1_INVALID_DATA |
| 396 | |
| 397 | BIT STRING: octets=2, unused_bits=0 |
| 398 | get_bitstring:"0303004142":2:0:0:0 |
| 399 | |
| 400 | BIT STRING: octets=2, unused_bits=7 |
| 401 | get_bitstring:"0303074142":2:7:0:MBEDTLS_ERR_ASN1_INVALID_DATA |
| 402 | |
| 403 | BIT STRING: octets=2, unused_bits=8 |
| 404 | get_bitstring:"0303084142":2:8:MBEDTLS_ERR_ASN1_INVALID_LENGTH:MBEDTLS_ERR_ASN1_INVALID_DATA |
| 405 | |
| 406 | BIT STRING with trailing garbage, unused_bits=0 |
| 407 | get_bitstring:"030200417e":1:0:MBEDTLS_ERR_ASN1_LENGTH_MISMATCH:0 |
| 408 | |
| 409 | BIT STRING with trailing garbage, unused_bits=7 |
| 410 | get_bitstring:"030207417e":1:7:MBEDTLS_ERR_ASN1_LENGTH_MISMATCH:MBEDTLS_ERR_ASN1_INVALID_DATA |
| 411 | |
| 412 | BIT STRING with trailing garbage, unused_bits=8 |
| 413 | get_bitstring:"030208417e":1:8:MBEDTLS_ERR_ASN1_INVALID_LENGTH:MBEDTLS_ERR_ASN1_INVALID_DATA |
| 414 | |
| 415 | Not BIT STRING |
| 416 | get_bitstring:"04020100":0:0:MBEDTLS_ERR_ASN1_UNEXPECTED_TAG:MBEDTLS_ERR_ASN1_UNEXPECTED_TAG |
| 417 | |
| 418 | SEQUENCE OF 0 OCTET STRING |
| 419 | get_sequence_of:"3000":0x04:"":0 |
| 420 | |
| 421 | SEQUENCE OF 0 OCTET STRING plus trailing garbage |
| 422 | get_sequence_of:"30007e":0x04:"":MBEDTLS_ERR_ASN1_LENGTH_MISMATCH |
| 423 | |
| 424 | SEQUENCE of 1 OCTET STRING truncated after tag |
| 425 | get_sequence_of:"300104":0x04:"":MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 426 | |
| 427 | SEQUENCE of 1 OCTET STRING truncated in length #1 |
| 428 | get_sequence_of:"30020481":0x04:"":MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 429 | |
| 430 | SEQUENCE of 1 OCTET STRING truncated in length #2 |
| 431 | get_sequence_of:"3003048201":0x04:"":MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 432 | |
| 433 | SEQUENCE of 1 OCTET STRING truncated in content #1 |
| 434 | get_sequence_of:"30020401":0x04:"":MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 435 | |
| 436 | SEQUENCE of 1 OCTET STRING truncated in content #2 |
| 437 | get_sequence_of:"3003040241":0x04:"":MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 438 | |
| 439 | SEQUENCE of 1 OCTET STRING truncated in content #3 |
| 440 | get_sequence_of:"300404034142":0x04:"":MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 441 | |
| 442 | SEQUENCE of 1 OCTET STRING (0) |
| 443 | get_sequence_of:"30020400":0x04:"4,0":0 |
| 444 | |
| 445 | SEQUENCE of 1 OCTET STRING (1) |
| 446 | get_sequence_of:"3003040141":0x04:"4,1":0 |
| 447 | |
| 448 | SEQUENCE of 1 OCTET STRING (126) |
| 449 | get_sequence_of:"308180047e414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141":0x04:"5,126":0 |
| 450 | |
| 451 | SEQUENCE of 2 OCTET STRINGs, second truncated after tag |
| 452 | get_sequence_of:"30050402414104":0x04:"":MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 453 | |
| 454 | SEQUENCE of 2 OCTET STRINGs, second truncated in length #1 |
| 455 | get_sequence_of:"3006040241410481":0x04:"":MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 456 | |
| 457 | SEQUENCE of 2 OCTET STRINGs, second truncated in length #2 |
| 458 | get_sequence_of:"300704024141048201":0x04:"":MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 459 | |
| 460 | SEQUENCE of 2 OCTET STRINGs, second truncated in content #1 |
| 461 | get_sequence_of:"3006040241410401":0x04:"":MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 462 | |
| 463 | SEQUENCE of 2 OCTET STRINGs, second truncated in content #2 |
| 464 | get_sequence_of:"300704024141040241":0x04:"":MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 465 | |
| 466 | SEQUENCE of 2 OCTET STRINGs, second truncated in content #3 |
| 467 | get_sequence_of:"30080402414104034142":0x04:"":MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 468 | |
| 469 | SEQUENCE of 2 OCTET STRINGs (2, 0) |
| 470 | get_sequence_of:"3006040241410400":0x04:"4,2,8,0":0 |
| 471 | |
| 472 | SEQUENCE of 2 OCTET STRINGs (2, 1) |
| 473 | get_sequence_of:"300704024141040142":0x04:"4,2,8,1":0 |
| 474 | |
| 475 | SEQUENCE of 2 OCTET STRINGs (0, 2) |
| 476 | get_sequence_of:"3006040004024141":0x04:"4,0,6,2":0 |
| 477 | |
| 478 | SEQUENCE of 2 OCTET STRINGs (1, 2) |
| 479 | get_sequence_of:"300704014104024242":0x04:"4,1,7,2":0 |
| 480 | |
| 481 | Not a SEQUENCE (not CONSTRUCTED) |
| 482 | get_sequence_of:"1000":0x04:"":MBEDTLS_ERR_ASN1_UNEXPECTED_TAG |
| 483 | |
| 484 | Not a SEQUENCE (not SEQUENCE) |
| 485 | get_sequence_of:"3100":0x04:"":MBEDTLS_ERR_ASN1_UNEXPECTED_TAG |
| 486 | |
Hanno Becker | 199b709 | 2019-09-11 14:21:26 +0100 | [diff] [blame] | 487 | Traverse empty SEQUENCE |
| 488 | traverse_sequence_of:"3000":0:0:0:0:"":0 |
| 489 | |
| 490 | Traverse empty SEQUENCE plus trailing garbage |
| 491 | traverse_sequence_of:"30007e":0:0:0:0:"":MBEDTLS_ERR_ASN1_LENGTH_MISMATCH |
| 492 | |
| 493 | Traverse SEQUENCE of INTEGER: 1 INTEGER |
| 494 | traverse_sequence_of:"30050203123456":0xff:0x02:0:0:"4,0x02,3":0 |
| 495 | |
| 496 | Traverse SEQUENCE of INTEGER: 2 INTEGERs |
| 497 | traverse_sequence_of:"30080203123456020178":0xff:0x02:0:0:"4,0x02,3,9,0x02,1":0 |
| 498 | |
| 499 | Traverse SEQUENCE of INTEGER: INTEGER, NULL |
| 500 | traverse_sequence_of:"300702031234560500":0xff:0x02:0:0:"4,0x02,3":MBEDTLS_ERR_ASN1_UNEXPECTED_TAG |
| 501 | |
| 502 | Traverse SEQUENCE of INTEGER: NULL, INTEGER |
| 503 | traverse_sequence_of:"300705000203123456":0xff:0x02:0:0:"":MBEDTLS_ERR_ASN1_UNEXPECTED_TAG |
| 504 | |
| 505 | Traverse SEQUENCE of ANY: NULL, INTEGER |
| 506 | traverse_sequence_of:"300705000203123456":0:0:0:0:"4,0x05,0,6,0x02,3":0 |
| 507 | |
| 508 | Traverse SEQUENCE of ANY, skip non-INTEGER: INTEGER, NULL |
| 509 | traverse_sequence_of:"300702031234560500":0:0:0xff:0x02:"4,0x02,3":0 |
| 510 | |
| 511 | Traverse SEQUENCE of ANY, skip non-INTEGER: NULL, INTEGER |
| 512 | traverse_sequence_of:"300705000203123456":0:0:0xff:0x02:"6,0x02,3":0 |
| 513 | |
| 514 | Traverse SEQUENCE of INTEGER, skip everything |
| 515 | traverse_sequence_of:"30080203123456020178":0xff:0x02:0:1:"":0 |
| 516 | |
| 517 | Traverse SEQUENCE of {NULL, OCTET STRING}, skip NULL: OS, NULL |
| 518 | traverse_sequence_of:"300704031234560500":0xfe:0x04:0xff:0x04:"4,0x04,3":0 |
| 519 | |
| 520 | Traverse SEQUENCE of {NULL, OCTET STRING}, skip NULL: NULL, OS |
| 521 | traverse_sequence_of:"300705000403123456":0xfe:0x04:0xff:0x04:"6,0x04,3":0 |
| 522 | |
| 523 | Traverse SEQUENCE of {NULL, OCTET STRING}, skip everything |
| 524 | traverse_sequence_of:"300705000403123456":0xfe:0x04:0:1:"":0 |
| 525 | |
| 526 | Traverse SEQUENCE of INTEGER, stop at 0: NULL |
| 527 | traverse_sequence_of:"30020500":0xff:0x02:0:0:"":MBEDTLS_ERR_ASN1_UNEXPECTED_TAG |
| 528 | |
| 529 | Traverse SEQUENCE of INTEGER, stop at 0: INTEGER |
| 530 | traverse_sequence_of:"30050203123456":0xff:0x02:0:0:"":RET_TRAVERSE_STOP |
| 531 | |
| 532 | Traverse SEQUENCE of INTEGER, stop at 0: INTEGER, NULL |
| 533 | traverse_sequence_of:"300702031234560500":0xff:0x02:0:0:"":RET_TRAVERSE_STOP |
| 534 | |
| 535 | Traverse SEQUENCE of INTEGER, stop at 1: INTEGER, NULL |
| 536 | traverse_sequence_of:"300702031234560500":0xff:0x02:0:0:"4,0x02,3":MBEDTLS_ERR_ASN1_UNEXPECTED_TAG |
| 537 | |
| 538 | Traverse SEQUENCE of INTEGER, stop at 1: INTEGER, INTEGER |
| 539 | traverse_sequence_of:"30080203123456020178":0xff:0x02:0:0:"4,0x02,3":RET_TRAVERSE_STOP |
| 540 | |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 541 | AlgorithmIdentifier, no params |
| 542 | get_alg:"300506034f4944":4:3:0:0:0:7:0 |
| 543 | |
| 544 | AlgorithmIdentifier, no params, trailing garbage |
| 545 | get_alg:"300506034f49447e":4:3:0:0:0:7:0 |
| 546 | |
| 547 | AlgorithmIdentifier, null params |
| 548 | get_alg:"300706034f49440500":4:3:0x05:9:0:9:0 |
| 549 | |
| 550 | AlgorithmIdentifier, null params, trailing garbage |
| 551 | get_alg:"300706034f494405007e":4:3:0x05:9:0:9:0 |
| 552 | |
| 553 | AlgorithmIdentifier, OCTET STRING params |
| 554 | get_alg:"300c06034f494404056162636465":4:3:0x04:9:5:14:0 |
| 555 | |
| 556 | AlgorithmIdentifier, truncated before OID |
| 557 | get_alg:"3000":4:3:0:0:0:2:MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 558 | |
| 559 | AlgorithmIdentifier, truncated in OID after tag |
| 560 | get_alg:"300106":0:0:0:0:0:3:MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 561 | |
| 562 | AlgorithmIdentifier, truncated in OID after length |
| 563 | get_alg:"30020603":4:3:0:0:0:4:MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 564 | |
| 565 | AlgorithmIdentifier, truncated inside OID content |
| 566 | get_alg:"300406034f49":4:3:0:0:0:6:MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 567 | |
| 568 | AlgorithmIdentifier, truncated in params after tag |
| 569 | get_alg:"300606034f494404":4:3:0x04:0:0:8:MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 570 | |
| 571 | AlgorithmIdentifier, truncated in params after length |
| 572 | get_alg:"300706034f49440405":4:3:0x04:9:0:9:MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 573 | |
| 574 | AlgorithmIdentifier, truncated inside params content |
| 575 | get_alg:"300806034f4944040561":4:3:0x04:9:5:10:MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 576 | |
| 577 | Not an AlgorithmIdentifier (not a SEQUENCE) |
| 578 | get_alg:"310506034f4944":0:0:0:0:0:0:MBEDTLS_ERR_ASN1_UNEXPECTED_TAG |
| 579 | |
| 580 | Not an AlgorithmIdentifier (empty SEQUENCE) |
| 581 | get_alg:"3000":0:0:0:0:0:0:MBEDTLS_ERR_ASN1_OUT_OF_DATA |
| 582 | |
| 583 | Not an AlgorithmIdentifier (not an OID) |
| 584 | get_alg:"3006050006034f4944":0:0:0:0:0:0:MBEDTLS_ERR_ASN1_UNEXPECTED_TAG |
| 585 | |
| 586 | Not an AlgorithmIdentifier (too many elements) |
| 587 | get_alg:"300f06034f494406034f494406034f4944":0:0:0:0:0:0:MBEDTLS_ERR_ASN1_LENGTH_MISMATCH |
| 588 | |
| 589 | Find named data: not found |
| 590 | find_named_data:"414141":"424242":"434343":"444444":"7f7f7f":0:4 |
| 591 | |
| 592 | Find named data: empty haystack |
| 593 | find_named_data:"414141":"424242":"434343":"444444":"7f7f7f":4:4 |
| 594 | |
| 595 | Find named data: first |
| 596 | find_named_data:"414141":"424242":"434343":"444444":"414141":0:0 |
| 597 | |
| 598 | Find named data: last |
| 599 | find_named_data:"414141":"424242":"434343":"444444":"444444":0:3 |
| 600 | |
| 601 | Find named data: skip suffix |
| 602 | find_named_data:"41414141":"414141":"434343":"444444":"414141":0:1 |
| 603 | |
| 604 | Find named data: skip prefix |
| 605 | find_named_data:"4141":"414141":"434343":"444444":"414141":0:1 |
| 606 | |
| 607 | Find named data: first match |
| 608 | find_named_data:"414141":"414141":"434343":"444444":"414141":0:0 |
| 609 | |
| 610 | Free named data: null pointer |
Glenn Strauss | 82ba274 | 2022-11-04 04:01:23 -0400 | [diff] [blame] | 611 | depends_on:MBEDTLS_TEST_DEPRECATED |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 612 | free_named_data_null: |
| 613 | |
| 614 | Free named data: all null |
Glenn Strauss | 82ba274 | 2022-11-04 04:01:23 -0400 | [diff] [blame] | 615 | depends_on:MBEDTLS_TEST_DEPRECATED |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 616 | free_named_data:0:0:0 |
| 617 | |
| 618 | Free named data: with oid |
Glenn Strauss | 82ba274 | 2022-11-04 04:01:23 -0400 | [diff] [blame] | 619 | depends_on:MBEDTLS_TEST_DEPRECATED |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 620 | free_named_data:1:0:0 |
| 621 | |
| 622 | Free named data: with val |
Glenn Strauss | 82ba274 | 2022-11-04 04:01:23 -0400 | [diff] [blame] | 623 | depends_on:MBEDTLS_TEST_DEPRECATED |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 624 | free_named_data:0:1:0 |
| 625 | |
| 626 | Free named data: with next |
Glenn Strauss | 82ba274 | 2022-11-04 04:01:23 -0400 | [diff] [blame] | 627 | depends_on:MBEDTLS_TEST_DEPRECATED |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 628 | free_named_data:0:0:1 |
| 629 | |
| 630 | Free named data list (empty) |
| 631 | free_named_data_list:0 |
| 632 | |
| 633 | Free named data list (1) |
Gilles Peskine | 88f136f | 2019-09-20 21:06:27 +0200 | [diff] [blame] | 634 | free_named_data_list:1 |
Gilles Peskine | 27d806f | 2019-03-01 18:02:53 +0100 | [diff] [blame] | 635 | |
| 636 | Free named data list (2) |
Gilles Peskine | 88f136f | 2019-09-20 21:06:27 +0200 | [diff] [blame] | 637 | free_named_data_list:2 |