Lines Matching refs:cursor

73 	__inout		efx_asn1_cursor_t	*cursor,  in efx_asn1_parse_header_match_tag()  argument
78 if (cursor == NULL || cursor->buffer == NULL || cursor->length < 2) { in efx_asn1_parse_header_match_tag()
83 cursor->tag = cursor->buffer[0]; in efx_asn1_parse_header_match_tag()
84 if (cursor->tag != tag) { in efx_asn1_parse_header_match_tag()
90 if ((cursor->tag & 0x1F) == 0x1F) { in efx_asn1_parse_header_match_tag()
96 if ((cursor->buffer[1] & 0x80) == 0) { in efx_asn1_parse_header_match_tag()
98 cursor->hdr_size = 2; in efx_asn1_parse_header_match_tag()
99 cursor->val_size = cursor->buffer[1]; in efx_asn1_parse_header_match_tag()
102 uint32_t nbytes = cursor->buffer[1] & 0x7F; in efx_asn1_parse_header_match_tag()
110 if (2 + nbytes > cursor->length) { in efx_asn1_parse_header_match_tag()
120 cursor->hdr_size = 2 + nbytes; in efx_asn1_parse_header_match_tag()
121 cursor->val_size = 0; in efx_asn1_parse_header_match_tag()
122 for (offset = 2; offset < cursor->hdr_size; offset++) { in efx_asn1_parse_header_match_tag()
123 cursor->val_size = in efx_asn1_parse_header_match_tag()
124 (cursor->val_size << 8) | cursor->buffer[offset]; in efx_asn1_parse_header_match_tag()
128 if ((cursor->hdr_size + cursor->val_size) > cursor->length) { in efx_asn1_parse_header_match_tag()
157 __inout efx_asn1_cursor_t *cursor, in efx_asn1_enter_tag() argument
162 if (cursor == NULL) { in efx_asn1_enter_tag()
172 rc = efx_asn1_parse_header_match_tag(cursor, tag); in efx_asn1_enter_tag()
179 cursor->buffer += cursor->hdr_size; in efx_asn1_enter_tag()
180 cursor->length = cursor->val_size; in efx_asn1_enter_tag()
200 __inout efx_asn1_cursor_t *cursor, in efx_asn1_match_tag_value() argument
207 if (cursor == NULL) { in efx_asn1_match_tag_value()
211 rc = efx_asn1_parse_header_match_tag(cursor, tag); in efx_asn1_match_tag_value()
216 if (cursor->val_size != val_size) { in efx_asn1_match_tag_value()
221 if (memcmp(cursor->buffer + cursor->hdr_size, valp, val_size) != 0) { in efx_asn1_match_tag_value()
226 cursor->buffer += cursor->hdr_size + cursor->val_size; in efx_asn1_match_tag_value()
227 cursor->length -= cursor->hdr_size + cursor->val_size; in efx_asn1_match_tag_value()
246 __inout efx_asn1_cursor_t *cursor, in efx_asn1_skip_tag() argument
251 if (cursor == NULL) { in efx_asn1_skip_tag()
256 rc = efx_asn1_parse_header_match_tag(cursor, tag); in efx_asn1_skip_tag()
261 cursor->buffer += cursor->hdr_size + cursor->val_size; in efx_asn1_skip_tag()
262 cursor->length -= cursor->hdr_size + cursor->val_size; in efx_asn1_skip_tag()
277 __inout efx_asn1_cursor_t *cursor, in efx_asn1_get_tag_value() argument
284 if (cursor == NULL || valp == NULL || val_sizep == NULL) { in efx_asn1_get_tag_value()
289 rc = efx_asn1_parse_header_match_tag(cursor, tag); in efx_asn1_get_tag_value()
294 *valp = cursor->buffer + cursor->hdr_size; in efx_asn1_get_tag_value()
295 *val_sizep = cursor->val_size; in efx_asn1_get_tag_value()
336 efx_asn1_cursor_t cursor; in efx_check_signed_image_header() local
345 cursor.buffer = (uint8_t *)bufferp; in efx_check_signed_image_header()
346 cursor.length = buffer_size; in efx_check_signed_image_header()
349 rc = efx_asn1_enter_tag(&cursor, ASN1_TAG_SEQUENCE); in efx_check_signed_image_header()
354 rc = efx_asn1_match_tag_value(&cursor, ASN1_TAG_OBJ_ID, in efx_check_signed_image_header()
360 rc = efx_asn1_enter_tag(&cursor, ASN1_TAG_CONS_CONTEXT(0)); in efx_check_signed_image_header()
365 rc = efx_asn1_enter_tag(&cursor, ASN1_TAG_SEQUENCE); in efx_check_signed_image_header()
370 rc = efx_asn1_match_tag_value(&cursor, ASN1_TAG_INTEGER, in efx_check_signed_image_header()
376 rc = efx_asn1_skip_tag(&cursor, ASN1_TAG_SET); in efx_check_signed_image_header()
381 rc = efx_asn1_enter_tag(&cursor, ASN1_TAG_SEQUENCE); in efx_check_signed_image_header()
386 rc = efx_asn1_match_tag_value(&cursor, ASN1_TAG_OBJ_ID, in efx_check_signed_image_header()
392 rc = efx_asn1_enter_tag(&cursor, ASN1_TAG_CONS_CONTEXT(0)); in efx_check_signed_image_header()
402 rc = efx_asn1_get_tag_value(&cursor, ASN1_TAG_OCTET_STRING, in efx_check_signed_image_header()