Lines Matching refs:cursor

47 	__inout		efx_asn1_cursor_t	*cursor,  in efx_asn1_parse_header_match_tag()  argument
52 if (cursor == NULL || cursor->buffer == NULL || cursor->length < 2) { in efx_asn1_parse_header_match_tag()
57 cursor->tag = cursor->buffer[0]; in efx_asn1_parse_header_match_tag()
58 if (cursor->tag != tag) { in efx_asn1_parse_header_match_tag()
64 if ((cursor->tag & 0x1F) == 0x1F) { in efx_asn1_parse_header_match_tag()
70 if ((cursor->buffer[1] & 0x80) == 0) { in efx_asn1_parse_header_match_tag()
72 cursor->hdr_size = 2; in efx_asn1_parse_header_match_tag()
73 cursor->val_size = cursor->buffer[1]; in efx_asn1_parse_header_match_tag()
76 uint32_t nbytes = cursor->buffer[1] & 0x7F; in efx_asn1_parse_header_match_tag()
84 if (2 + nbytes > cursor->length) { in efx_asn1_parse_header_match_tag()
94 cursor->hdr_size = 2 + nbytes; in efx_asn1_parse_header_match_tag()
95 cursor->val_size = 0; in efx_asn1_parse_header_match_tag()
96 for (offset = 2; offset < cursor->hdr_size; offset++) { in efx_asn1_parse_header_match_tag()
97 cursor->val_size = in efx_asn1_parse_header_match_tag()
98 (cursor->val_size << 8) | cursor->buffer[offset]; in efx_asn1_parse_header_match_tag()
102 if ((cursor->hdr_size + cursor->val_size) > cursor->length) { in efx_asn1_parse_header_match_tag()
131 __inout efx_asn1_cursor_t *cursor, in efx_asn1_enter_tag() argument
136 if (cursor == NULL) { in efx_asn1_enter_tag()
146 rc = efx_asn1_parse_header_match_tag(cursor, tag); in efx_asn1_enter_tag()
153 cursor->buffer += cursor->hdr_size; in efx_asn1_enter_tag()
154 cursor->length = cursor->val_size; in efx_asn1_enter_tag()
174 __inout efx_asn1_cursor_t *cursor, in efx_asn1_match_tag_value() argument
181 if (cursor == NULL) { in efx_asn1_match_tag_value()
185 rc = efx_asn1_parse_header_match_tag(cursor, tag); in efx_asn1_match_tag_value()
190 if (cursor->val_size != val_size) { in efx_asn1_match_tag_value()
195 if (memcmp(cursor->buffer + cursor->hdr_size, valp, val_size) != 0) { in efx_asn1_match_tag_value()
200 cursor->buffer += cursor->hdr_size + cursor->val_size; in efx_asn1_match_tag_value()
201 cursor->length -= cursor->hdr_size + cursor->val_size; in efx_asn1_match_tag_value()
220 __inout efx_asn1_cursor_t *cursor, in efx_asn1_skip_tag() argument
225 if (cursor == NULL) { in efx_asn1_skip_tag()
230 rc = efx_asn1_parse_header_match_tag(cursor, tag); in efx_asn1_skip_tag()
235 cursor->buffer += cursor->hdr_size + cursor->val_size; in efx_asn1_skip_tag()
236 cursor->length -= cursor->hdr_size + cursor->val_size; in efx_asn1_skip_tag()
251 __inout efx_asn1_cursor_t *cursor, in efx_asn1_get_tag_value() argument
258 if (cursor == NULL || valp == NULL || val_sizep == NULL) { in efx_asn1_get_tag_value()
263 rc = efx_asn1_parse_header_match_tag(cursor, tag); in efx_asn1_get_tag_value()
268 *valp = cursor->buffer + cursor->hdr_size; in efx_asn1_get_tag_value()
269 *val_sizep = cursor->val_size; in efx_asn1_get_tag_value()
311 efx_asn1_cursor_t cursor; in efx_check_signed_image_header() local
320 cursor.buffer = (uint8_t *)bufferp; in efx_check_signed_image_header()
321 cursor.length = buffer_size; in efx_check_signed_image_header()
324 rc = efx_asn1_enter_tag(&cursor, ASN1_TAG_SEQUENCE); in efx_check_signed_image_header()
329 rc = efx_asn1_match_tag_value(&cursor, ASN1_TAG_OBJ_ID, in efx_check_signed_image_header()
335 rc = efx_asn1_enter_tag(&cursor, ASN1_TAG_CONS_CONTEXT(0)); in efx_check_signed_image_header()
340 rc = efx_asn1_enter_tag(&cursor, ASN1_TAG_SEQUENCE); in efx_check_signed_image_header()
345 rc = efx_asn1_match_tag_value(&cursor, ASN1_TAG_INTEGER, in efx_check_signed_image_header()
351 rc = efx_asn1_skip_tag(&cursor, ASN1_TAG_SET); in efx_check_signed_image_header()
356 rc = efx_asn1_enter_tag(&cursor, ASN1_TAG_SEQUENCE); in efx_check_signed_image_header()
361 rc = efx_asn1_match_tag_value(&cursor, ASN1_TAG_OBJ_ID, in efx_check_signed_image_header()
367 rc = efx_asn1_enter_tag(&cursor, ASN1_TAG_CONS_CONTEXT(0)); in efx_check_signed_image_header()
377 rc = efx_asn1_get_tag_value(&cursor, ASN1_TAG_OCTET_STRING, in efx_check_signed_image_header()