Lines Matching refs:p
68 static int x509_crl_get_version( unsigned char **p, in x509_crl_get_version() argument
74 if( ( ret = mbedtls_asn1_get_int( p, end, ver ) ) != 0 ) in x509_crl_get_version()
95 static int x509_get_crl_ext( unsigned char **p, in x509_get_crl_ext() argument
101 if( *p == end ) in x509_get_crl_ext()
108 if( ( ret = mbedtls_x509_get_ext( p, end, ext, 0 ) ) != 0 ) in x509_get_crl_ext()
111 end = ext->p + ext->len; in x509_get_crl_ext()
113 while( *p < end ) in x509_get_crl_ext()
126 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in x509_get_crl_ext()
130 end_ext_data = *p + len; in x509_get_crl_ext()
133 if( ( ret = mbedtls_asn1_get_tag( p, end_ext_data, &len, in x509_get_crl_ext()
138 *p += len; in x509_get_crl_ext()
141 if( ( ret = mbedtls_asn1_get_bool( p, end_ext_data, in x509_get_crl_ext()
149 if( ( ret = mbedtls_asn1_get_tag( p, end_ext_data, &len, in x509_get_crl_ext()
154 *p += len; in x509_get_crl_ext()
155 if( *p != end_ext_data ) in x509_get_crl_ext()
165 if( *p != end ) in x509_get_crl_ext()
175 static int x509_get_crl_entry_ext( unsigned char **p, in x509_get_crl_entry_ext() argument
183 if( end <= *p ) in x509_get_crl_entry_ext()
186 ext->tag = **p; in x509_get_crl_entry_ext()
187 ext->p = *p; in x509_get_crl_entry_ext()
193 if( ( ret = mbedtls_asn1_get_tag( p, end, &ext->len, in x509_get_crl_entry_ext()
198 ext->p = NULL; in x509_get_crl_entry_ext()
204 end = *p + ext->len; in x509_get_crl_entry_ext()
206 if( end != *p + ext->len ) in x509_get_crl_entry_ext()
210 while( *p < end ) in x509_get_crl_entry_ext()
212 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in x509_get_crl_entry_ext()
216 *p += len; in x509_get_crl_entry_ext()
219 if( *p != end ) in x509_get_crl_entry_ext()
229 static int x509_get_entries( unsigned char **p, in x509_get_entries() argument
237 if( *p == end ) in x509_get_entries()
240 if( ( ret = mbedtls_asn1_get_tag( p, end, &entry_len, in x509_get_entries()
249 end = *p + entry_len; in x509_get_entries()
251 while( *p < end ) in x509_get_entries()
256 cur_entry->raw.tag = **p; in x509_get_entries()
257 if( ( ret = mbedtls_asn1_get_tag( p, end, &len2, in x509_get_entries()
263 cur_entry->raw.p = *p; in x509_get_entries()
265 end2 = *p + len2; in x509_get_entries()
267 if( ( ret = mbedtls_x509_get_serial( p, end2, &cur_entry->serial ) ) != 0 ) in x509_get_entries()
270 if( ( ret = mbedtls_x509_get_time( p, end2, in x509_get_entries()
274 if( ( ret = x509_get_crl_entry_ext( p, end2, in x509_get_entries()
278 if( *p < end ) in x509_get_entries()
300 unsigned char *p = NULL, *end = NULL; in mbedtls_x509_crl_parse_der() local
340 p = mbedtls_calloc( 1, buflen ); in mbedtls_x509_crl_parse_der()
341 if( p == NULL ) in mbedtls_x509_crl_parse_der()
344 memcpy( p, buf, buflen ); in mbedtls_x509_crl_parse_der()
346 crl->raw.p = p; in mbedtls_x509_crl_parse_der()
349 end = p + buflen; in mbedtls_x509_crl_parse_der()
357 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_crl_parse_der()
364 if( len != (size_t) ( end - p ) ) in mbedtls_x509_crl_parse_der()
374 crl->tbs.p = p; in mbedtls_x509_crl_parse_der()
376 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_crl_parse_der()
383 end = p + len; in mbedtls_x509_crl_parse_der()
384 crl->tbs.len = end - crl->tbs.p; in mbedtls_x509_crl_parse_der()
392 if( ( ret = x509_crl_get_version( &p, end, &crl->version ) ) != 0 || in mbedtls_x509_crl_parse_der()
393 ( ret = mbedtls_x509_get_alg( &p, end, &crl->sig_oid, &sig_params1 ) ) != 0 ) in mbedtls_x509_crl_parse_der()
418 crl->issuer_raw.p = p; in mbedtls_x509_crl_parse_der()
420 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_crl_parse_der()
427 if( ( ret = mbedtls_x509_get_name( &p, p + len, &crl->issuer ) ) != 0 ) in mbedtls_x509_crl_parse_der()
433 crl->issuer_raw.len = p - crl->issuer_raw.p; in mbedtls_x509_crl_parse_der()
439 if( ( ret = mbedtls_x509_get_time( &p, end, &crl->this_update ) ) != 0 ) in mbedtls_x509_crl_parse_der()
445 if( ( ret = mbedtls_x509_get_time( &p, end, &crl->next_update ) ) != 0 ) in mbedtls_x509_crl_parse_der()
465 if( ( ret = x509_get_entries( &p, end, &crl->entry ) ) != 0 ) in mbedtls_x509_crl_parse_der()
477 ret = x509_get_crl_ext( &p, end, &crl->crl_ext ); in mbedtls_x509_crl_parse_der()
486 if( p != end ) in mbedtls_x509_crl_parse_der()
493 end = crl->raw.p + crl->raw.len; in mbedtls_x509_crl_parse_der()
499 if( ( ret = mbedtls_x509_get_alg( &p, end, &sig_oid2, &sig_params2 ) ) != 0 ) in mbedtls_x509_crl_parse_der()
506 memcmp( crl->sig_oid.p, sig_oid2.p, crl->sig_oid.len ) != 0 || in mbedtls_x509_crl_parse_der()
509 memcmp( sig_params1.p, sig_params2.p, sig_params1.len ) != 0 ) ) in mbedtls_x509_crl_parse_der()
515 if( ( ret = mbedtls_x509_get_sig( &p, end, &crl->sig ) ) != 0 ) in mbedtls_x509_crl_parse_der()
521 if( p != end ) in mbedtls_x509_crl_parse_der()
630 char *p; in mbedtls_x509_crl_info() local
633 p = buf; in mbedtls_x509_crl_info()
636 ret = mbedtls_snprintf( p, n, "%sCRL version : %d", in mbedtls_x509_crl_info()
640 ret = mbedtls_snprintf( p, n, "\n%sissuer name : ", prefix ); in mbedtls_x509_crl_info()
642 ret = mbedtls_x509_dn_gets( p, n, &crl->issuer ); in mbedtls_x509_crl_info()
645 ret = mbedtls_snprintf( p, n, "\n%sthis update : " \ in mbedtls_x509_crl_info()
652 ret = mbedtls_snprintf( p, n, "\n%snext update : " \ in mbedtls_x509_crl_info()
661 ret = mbedtls_snprintf( p, n, "\n%sRevoked certificates:", in mbedtls_x509_crl_info()
667 ret = mbedtls_snprintf( p, n, "\n%sserial number: ", in mbedtls_x509_crl_info()
671 ret = mbedtls_x509_serial_gets( p, n, &entry->serial ); in mbedtls_x509_crl_info()
674 ret = mbedtls_snprintf( p, n, " revocation date: " \ in mbedtls_x509_crl_info()
684 ret = mbedtls_snprintf( p, n, "\n%ssigned using : ", prefix ); in mbedtls_x509_crl_info()
687 ret = mbedtls_x509_sig_alg_gets( p, n, &crl->sig_oid, crl->sig_pk, crl->sig_md, in mbedtls_x509_crl_info()
691 ret = mbedtls_snprintf( p, n, "\n" ); in mbedtls_x509_crl_info()
745 if( crl_cur->raw.p != NULL ) in mbedtls_x509_crl_free()
747 mbedtls_platform_zeroize( crl_cur->raw.p, crl_cur->raw.len ); in mbedtls_x509_crl_free()
748 mbedtls_free( crl_cur->raw.p ); in mbedtls_x509_crl_free()