Lines Matching +full:odd +full:- +full:numbered

1 // SPDX-License-Identifier: GPL-2.0-or-later
66 if (unlikely(datalen - dp < 2)) { in asn1_find_indefinite_length()
78 if (--indef_level <= 0) { in asn1_find_indefinite_length()
79 *_len = dp - *_dp; in asn1_find_indefinite_length()
88 if (unlikely(datalen - dp < 2)) in asn1_find_indefinite_length()
107 n = len - 0x80; in asn1_find_indefinite_length()
108 if (unlikely(n > sizeof(len) - 1)) in asn1_find_indefinite_length()
110 if (unlikely(n > datalen - dp)) in asn1_find_indefinite_length()
113 for (; n > 0; n--) { in asn1_find_indefinite_length()
118 if (len > datalen - dp) in asn1_find_indefinite_length()
139 return -1; in asn1_find_indefinite_length()
143 * asn1_ber_decoder - Decoder BER/DER/CER ASN.1 according to pattern
161 * (2) The stack of constructed types is 10 deep. If the depth of non-leaf
172 const unsigned char *machine = decoder->machine; in asn1_ber_decoder()
173 const asn1_action_t *actions = decoder->actions; in asn1_ber_decoder()
174 size_t machlen = decoder->machlen; in asn1_ber_decoder()
186 * - ie. whether or not we are going to parse in asn1_ber_decoder()
198 return -EMSGSIZE; in asn1_ber_decoder()
227 if (unlikely(datalen - dp < 2)) in asn1_ber_decoder()
234 pr_debug("- any %02x\n", tag); in asn1_ber_decoder()
237 * - Either CONS or PRIM are permitted in the data if in asn1_ber_decoder()
247 pr_debug("- match? %02x %02x %02x\n", tag, optag, tmp); in asn1_ber_decoder()
249 /* All odd-numbered tags are MATCH_OR_SKIP. */ in asn1_ber_decoder()
252 dp--; in asn1_ber_decoder()
267 if (unlikely(2 > datalen - dp)) in asn1_ber_decoder()
270 int n = len - 0x80; in asn1_ber_decoder()
273 if (unlikely(n > datalen - dp)) in asn1_ber_decoder()
276 for (len = 0; n > 0; n--) { in asn1_ber_decoder()
280 if (unlikely(len > datalen - dp)) in asn1_ber_decoder()
284 if (unlikely(len > datalen - dp)) in asn1_ber_decoder()
305 pr_debug("- TAG: %02x %zu%s\n", in asn1_ber_decoder()
336 pr_debug("- LEAF: %zu\n", len); in asn1_ber_decoder()
359 pr_debug("- MATCH_JUMP\n"); in asn1_ber_decoder()
376 return -EBADMSG; in asn1_ber_decoder()
394 csp--; in asn1_ber_decoder()
399 pr_debug("- end cons t=%zu dp=%zu l=%zu/%zu\n", in asn1_ber_decoder()
402 /* Indefinite length - check for the EOC. */ in asn1_ber_decoder()
404 if (unlikely(datalen - dp < 2)) in asn1_ber_decoder()
408 dp--; in asn1_ber_decoder()
411 pr_debug("- continue\n"); in asn1_ber_decoder()
418 len = dp - tdp - 2; in asn1_ber_decoder()
424 pr_debug("- continue\n"); in asn1_ber_decoder()
429 len -= tdp; in asn1_ber_decoder()
430 pr_debug("- cons len l=%zu d=%zu\n", len, dp - tdp); in asn1_ber_decoder()
463 pc = jump_stack[--jsp]; in asn1_ber_decoder()
474 return -EBADMSG; in asn1_ber_decoder()
517 return -EBADMSG; in asn1_ber_decoder()