Lines Matching refs:hdr

116 	struct asn1_hdr hdr;  in tls_process_ocsp_single_response()  local
141 if (asn1_get_next(resp, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in tls_process_ocsp_single_response()
142 asn1_unexpected(&hdr, "OCSP: Expected SEQUENCE (CertID)"); in tls_process_ocsp_single_response()
145 pos = hdr.payload; in tls_process_ocsp_single_response()
146 end = hdr.payload + hdr.length; in tls_process_ocsp_single_response()
161 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_ocsp_single_response()
162 !asn1_is_octetstring(&hdr)) { in tls_process_ocsp_single_response()
163 asn1_unexpected(&hdr, in tls_process_ocsp_single_response()
167 name_hash = hdr.payload; in tls_process_ocsp_single_response()
168 name_hash_len = hdr.length; in tls_process_ocsp_single_response()
171 pos = hdr.payload + hdr.length; in tls_process_ocsp_single_response()
186 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_ocsp_single_response()
187 !asn1_is_octetstring(&hdr)) { in tls_process_ocsp_single_response()
188 asn1_unexpected(&hdr, in tls_process_ocsp_single_response()
192 key_hash = hdr.payload; in tls_process_ocsp_single_response()
193 key_hash_len = hdr.length; in tls_process_ocsp_single_response()
195 pos = hdr.payload + hdr.length; in tls_process_ocsp_single_response()
208 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_ocsp_single_response()
209 !asn1_is_integer(&hdr) || in tls_process_ocsp_single_response()
210 hdr.length < 1 || hdr.length > X509_MAX_SERIAL_NUM_LEN) { in tls_process_ocsp_single_response()
211 asn1_unexpected(&hdr, in tls_process_ocsp_single_response()
215 serial_number = hdr.payload; in tls_process_ocsp_single_response()
216 serial_number_len = hdr.length; in tls_process_ocsp_single_response()
241 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_ocsp_single_response()
242 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) { in tls_process_ocsp_single_response()
243 asn1_unexpected(&hdr, "OCSP: Expected CHOICE (CertStatus)"); in tls_process_ocsp_single_response()
246 cert_status = hdr.tag; in tls_process_ocsp_single_response()
249 hdr.payload, hdr.length); in tls_process_ocsp_single_response()
250 pos = hdr.payload + hdr.length; in tls_process_ocsp_single_response()
254 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_ocsp_single_response()
255 !asn1_is_generalizedtime(&hdr) || in tls_process_ocsp_single_response()
256 x509_parse_time(hdr.payload, hdr.length, hdr.tag, &update) < 0) { in tls_process_ocsp_single_response()
261 pos = hdr.payload + hdr.length; in tls_process_ocsp_single_response()
270 if (asn1_get_next(pos, end - pos, &hdr) < 0) in tls_process_ocsp_single_response()
272 if (asn1_is_cs_tag(&hdr, 0) && hdr.constructed) { in tls_process_ocsp_single_response()
273 const u8 *next = hdr.payload + hdr.length; in tls_process_ocsp_single_response()
275 if (asn1_get_next(hdr.payload, hdr.length, &hdr) < 0 || in tls_process_ocsp_single_response()
276 !asn1_is_generalizedtime(&hdr) || in tls_process_ocsp_single_response()
277 x509_parse_time(hdr.payload, hdr.length, hdr.tag, in tls_process_ocsp_single_response()
316 struct asn1_hdr hdr; in tls_process_ocsp_responses() local
324 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_ocsp_responses()
325 !asn1_is_sequence(&hdr)) { in tls_process_ocsp_responses()
326 asn1_unexpected(&hdr, in tls_process_ocsp_responses()
331 hdr.payload, hdr.length, in tls_process_ocsp_responses()
334 pos = hdr.payload + hdr.length; in tls_process_ocsp_responses()
348 struct asn1_hdr hdr; in tls_process_basic_ocsp_response() local
375 if (asn1_get_next(resp, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in tls_process_basic_ocsp_response()
376 asn1_unexpected(&hdr, in tls_process_basic_ocsp_response()
380 pos = hdr.payload; in tls_process_basic_ocsp_response()
381 end = hdr.payload + hdr.length; in tls_process_basic_ocsp_response()
384 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_basic_ocsp_response()
385 !asn1_is_sequence(&hdr)) { in tls_process_basic_ocsp_response()
386 asn1_unexpected(&hdr, in tls_process_basic_ocsp_response()
390 resp_data = hdr.payload; in tls_process_basic_ocsp_response()
391 resp_data_len = hdr.length; in tls_process_basic_ocsp_response()
393 pos = hdr.payload + hdr.length; in tls_process_basic_ocsp_response()
401 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_basic_ocsp_response()
402 !asn1_is_bitstring(&hdr)) { in tls_process_basic_ocsp_response()
403 asn1_unexpected(&hdr, in tls_process_basic_ocsp_response()
407 if (hdr.length < 1) in tls_process_basic_ocsp_response()
409 pos = hdr.payload; in tls_process_basic_ocsp_response()
419 sign_value_len = hdr.length - 1; in tls_process_basic_ocsp_response()
420 pos += hdr.length; in tls_process_basic_ocsp_response()
425 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_basic_ocsp_response()
426 !hdr.constructed || !asn1_is_cs_tag(&hdr, 0)) { in tls_process_basic_ocsp_response()
427 asn1_unexpected(&hdr, in tls_process_basic_ocsp_response()
432 hdr.payload, hdr.length); in tls_process_basic_ocsp_response()
433 pos = hdr.payload; in tls_process_basic_ocsp_response()
434 end = hdr.payload + hdr.length; in tls_process_basic_ocsp_response()
438 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_basic_ocsp_response()
439 !asn1_is_sequence(&hdr)) { in tls_process_basic_ocsp_response()
440 asn1_unexpected(&hdr, in tls_process_basic_ocsp_response()
445 cert = x509_certificate_parse(hdr.payload, hdr.length); in tls_process_basic_ocsp_response()
454 pos = hdr.payload + hdr.length; in tls_process_basic_ocsp_response()
474 if (asn1_get_next(pos, end - pos, &hdr) == 0 && hdr.constructed && in tls_process_basic_ocsp_response()
475 asn1_is_cs_tag(&hdr, 0)) { in tls_process_basic_ocsp_response()
476 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_basic_ocsp_response()
477 !asn1_is_integer(&hdr) || hdr.length != 1) { in tls_process_basic_ocsp_response()
478 asn1_unexpected(&hdr, in tls_process_basic_ocsp_response()
483 hdr.payload[0]); in tls_process_basic_ocsp_response()
484 if (hdr.payload[0] != 0) { in tls_process_basic_ocsp_response()
487 hdr.payload[0]); in tls_process_basic_ocsp_response()
490 pos = hdr.payload + hdr.length; in tls_process_basic_ocsp_response()
501 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_basic_ocsp_response()
502 hdr.class != ASN1_CLASS_CONTEXT_SPECIFIC) { in tls_process_basic_ocsp_response()
503 asn1_unexpected(&hdr, "OCSP: Expected CHOICE (ResponderID)"); in tls_process_basic_ocsp_response()
507 if (hdr.tag == 1) { in tls_process_basic_ocsp_response()
509 if (x509_parse_name(hdr.payload, hdr.length, &name, &pos) < 0) in tls_process_basic_ocsp_response()
513 } else if (hdr.tag == 2) { in tls_process_basic_ocsp_response()
515 if (asn1_get_next(hdr.payload, hdr.length, &hdr) < 0 || in tls_process_basic_ocsp_response()
516 !asn1_is_octetstring(&hdr)) { in tls_process_basic_ocsp_response()
517 asn1_unexpected(&hdr, in tls_process_basic_ocsp_response()
521 key_hash = hdr.payload; in tls_process_basic_ocsp_response()
523 key_hash, hdr.length); in tls_process_basic_ocsp_response()
524 if (hdr.length != SHA1_MAC_LEN) { in tls_process_basic_ocsp_response()
527 hdr.length, SHA1_MAC_LEN); in tls_process_basic_ocsp_response()
530 pos = hdr.payload + hdr.length; in tls_process_basic_ocsp_response()
533 hdr.tag); in tls_process_basic_ocsp_response()
538 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_basic_ocsp_response()
539 !asn1_is_generalizedtime(&hdr) || in tls_process_basic_ocsp_response()
540 x509_parse_time(hdr.payload, hdr.length, hdr.tag, in tls_process_basic_ocsp_response()
547 pos = hdr.payload + hdr.length; in tls_process_basic_ocsp_response()
550 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_basic_ocsp_response()
551 !asn1_is_sequence(&hdr)) { in tls_process_basic_ocsp_response()
552 asn1_unexpected(&hdr, in tls_process_basic_ocsp_response()
556 responses = hdr.payload; in tls_process_basic_ocsp_response()
557 responses_len = hdr.length; in tls_process_basic_ocsp_response()
559 pos = hdr.payload + hdr.length; in tls_process_basic_ocsp_response()
651 struct asn1_hdr hdr; in tls_process_ocsp_response() local
669 if (asn1_get_next(resp, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in tls_process_ocsp_response()
670 asn1_unexpected(&hdr, in tls_process_ocsp_response()
674 pos = hdr.payload; in tls_process_ocsp_response()
675 end = hdr.payload + hdr.length; in tls_process_ocsp_response()
678 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_ocsp_response()
679 !asn1_is_enumerated(&hdr) || hdr.length != 1) { in tls_process_ocsp_response()
680 asn1_unexpected(&hdr, in tls_process_ocsp_response()
684 resp_status = hdr.payload[0]; in tls_process_ocsp_response()
686 pos = hdr.payload + hdr.length; in tls_process_ocsp_response()
696 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !hdr.constructed || in tls_process_ocsp_response()
697 !asn1_is_cs_tag(&hdr, 0)) { in tls_process_ocsp_response()
698 asn1_unexpected(&hdr, in tls_process_ocsp_response()
709 if (asn1_get_next(hdr.payload, hdr.length, &hdr) < 0 || in tls_process_ocsp_response()
710 !asn1_is_sequence(&hdr)) { in tls_process_ocsp_response()
711 asn1_unexpected(&hdr, in tls_process_ocsp_response()
715 pos = hdr.payload; in tls_process_ocsp_response()
716 end = hdr.payload + hdr.length; in tls_process_ocsp_response()
732 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_ocsp_response()
733 !asn1_is_octetstring(&hdr)) { in tls_process_ocsp_response()
734 asn1_unexpected(&hdr, "OCSP: Expected OCTET STRING (response)"); in tls_process_ocsp_response()
749 hdr.payload, in tls_process_ocsp_response()
750 hdr.length); in tls_process_ocsp_response()