Lines Matching refs:p
88 int mbedtls_x509_get_serial( unsigned char **p, const unsigned char *end, in mbedtls_x509_get_serial() argument
93 if( ( end - *p ) < 1 ) in mbedtls_x509_get_serial()
97 if( **p != ( MBEDTLS_ASN1_CONTEXT_SPECIFIC | MBEDTLS_ASN1_PRIMITIVE | 2 ) && in mbedtls_x509_get_serial()
98 **p != MBEDTLS_ASN1_INTEGER ) in mbedtls_x509_get_serial()
102 serial->tag = *(*p)++; in mbedtls_x509_get_serial()
104 if( ( ret = mbedtls_asn1_get_len( p, end, &serial->len ) ) != 0 ) in mbedtls_x509_get_serial()
107 serial->p = *p; in mbedtls_x509_get_serial()
108 *p += serial->len; in mbedtls_x509_get_serial()
119 int mbedtls_x509_get_alg_null( unsigned char **p, const unsigned char *end, in mbedtls_x509_get_alg_null() argument
124 if( ( ret = mbedtls_asn1_get_alg_null( p, end, alg ) ) != 0 ) in mbedtls_x509_get_alg_null()
133 int mbedtls_x509_get_alg( unsigned char **p, const unsigned char *end, in mbedtls_x509_get_alg() argument
138 if( ( ret = mbedtls_asn1_get_alg( p, end, alg, params ) ) != 0 ) in mbedtls_x509_get_alg()
157 unsigned char *p; in x509_get_hash_alg() local
167 p = (unsigned char *) alg->p; in x509_get_hash_alg()
168 end = p + alg->len; in x509_get_hash_alg()
170 if( p >= end ) in x509_get_hash_alg()
175 md_oid.tag = *p; in x509_get_hash_alg()
177 if( ( ret = mbedtls_asn1_get_tag( &p, end, &md_oid.len, MBEDTLS_ASN1_OID ) ) != 0 ) in x509_get_hash_alg()
180 md_oid.p = p; in x509_get_hash_alg()
181 p += md_oid.len; in x509_get_hash_alg()
188 if( p == end ) in x509_get_hash_alg()
191 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, MBEDTLS_ASN1_NULL ) ) != 0 || len != 0 ) in x509_get_hash_alg()
194 if( p != end ) in x509_get_hash_alg()
218 unsigned char *p; in mbedtls_x509_get_rsassa_pss_params() local
233 p = (unsigned char *) params->p; in mbedtls_x509_get_rsassa_pss_params()
234 end = p + params->len; in mbedtls_x509_get_rsassa_pss_params()
236 if( p == end ) in mbedtls_x509_get_rsassa_pss_params()
242 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_get_rsassa_pss_params()
245 end2 = p + len; in mbedtls_x509_get_rsassa_pss_params()
248 if( ( ret = mbedtls_x509_get_alg_null( &p, end2, &alg_id ) ) != 0 ) in mbedtls_x509_get_rsassa_pss_params()
254 if( p != end2 ) in mbedtls_x509_get_rsassa_pss_params()
261 if( p == end ) in mbedtls_x509_get_rsassa_pss_params()
267 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_get_rsassa_pss_params()
270 end2 = p + len; in mbedtls_x509_get_rsassa_pss_params()
273 if( ( ret = mbedtls_x509_get_alg( &p, end2, &alg_id, &alg_params ) ) != 0 ) in mbedtls_x509_get_rsassa_pss_params()
285 if( p != end2 ) in mbedtls_x509_get_rsassa_pss_params()
292 if( p == end ) in mbedtls_x509_get_rsassa_pss_params()
298 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_get_rsassa_pss_params()
301 end2 = p + len; in mbedtls_x509_get_rsassa_pss_params()
303 if( ( ret = mbedtls_asn1_get_int( &p, end2, salt_len ) ) != 0 ) in mbedtls_x509_get_rsassa_pss_params()
306 if( p != end2 ) in mbedtls_x509_get_rsassa_pss_params()
313 if( p == end ) in mbedtls_x509_get_rsassa_pss_params()
319 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in mbedtls_x509_get_rsassa_pss_params()
324 end2 = p + len; in mbedtls_x509_get_rsassa_pss_params()
326 if( ( ret = mbedtls_asn1_get_int( &p, end2, &trailer_field ) ) != 0 ) in mbedtls_x509_get_rsassa_pss_params()
329 if( p != end2 ) in mbedtls_x509_get_rsassa_pss_params()
339 if( p != end ) in mbedtls_x509_get_rsassa_pss_params()
356 static int x509_get_attr_type_value( unsigned char **p, in x509_get_attr_type_value() argument
365 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in x509_get_attr_type_value()
369 if( ( end - *p ) < 1 ) in x509_get_attr_type_value()
374 oid->tag = **p; in x509_get_attr_type_value()
376 if( ( ret = mbedtls_asn1_get_tag( p, end, &oid->len, MBEDTLS_ASN1_OID ) ) != 0 ) in x509_get_attr_type_value()
379 oid->p = *p; in x509_get_attr_type_value()
380 *p += oid->len; in x509_get_attr_type_value()
382 if( ( end - *p ) < 1 ) in x509_get_attr_type_value()
386 if( **p != MBEDTLS_ASN1_BMP_STRING && **p != MBEDTLS_ASN1_UTF8_STRING && in x509_get_attr_type_value()
387 **p != MBEDTLS_ASN1_T61_STRING && **p != MBEDTLS_ASN1_PRINTABLE_STRING && in x509_get_attr_type_value()
388 **p != MBEDTLS_ASN1_IA5_STRING && **p != MBEDTLS_ASN1_UNIVERSAL_STRING && in x509_get_attr_type_value()
389 **p != MBEDTLS_ASN1_BIT_STRING ) in x509_get_attr_type_value()
394 val->tag = *(*p)++; in x509_get_attr_type_value()
396 if( ( ret = mbedtls_asn1_get_len( p, end, &val->len ) ) != 0 ) in x509_get_attr_type_value()
399 val->p = *p; in x509_get_attr_type_value()
400 *p += val->len; in x509_get_attr_type_value()
430 int mbedtls_x509_get_name( unsigned char **p, const unsigned char *end, in mbedtls_x509_get_name() argument
443 if( ( ret = mbedtls_asn1_get_tag( p, end, &set_len, in mbedtls_x509_get_name()
447 end_set = *p + set_len; in mbedtls_x509_get_name()
451 if( ( ret = x509_get_attr_type_value( p, end_set, cur ) ) != 0 ) in mbedtls_x509_get_name()
454 if( *p == end_set ) in mbedtls_x509_get_name()
471 if( *p == end ) in mbedtls_x509_get_name()
483 static int x509_parse_int(unsigned char **p, unsigned n, int *res){ in x509_parse_int() argument
486 if( ( **p < '0') || ( **p > '9' ) ) return MBEDTLS_ERR_X509_INVALID_DATE; in x509_parse_int()
488 *res += (*(*p)++ - '0'); in x509_parse_int()
525 int mbedtls_x509_get_time( unsigned char **p, const unsigned char *end, in mbedtls_x509_get_time() argument
532 if( ( end - *p ) < 1 ) in mbedtls_x509_get_time()
536 tag = **p; in mbedtls_x509_get_time()
540 (*p)++; in mbedtls_x509_get_time()
541 ret = mbedtls_asn1_get_len( p, end, &len ); in mbedtls_x509_get_time()
546 CHECK( x509_parse_int( p, 2, &time->year ) ); in mbedtls_x509_get_time()
547 CHECK( x509_parse_int( p, 2, &time->mon ) ); in mbedtls_x509_get_time()
548 CHECK( x509_parse_int( p, 2, &time->day ) ); in mbedtls_x509_get_time()
549 CHECK( x509_parse_int( p, 2, &time->hour ) ); in mbedtls_x509_get_time()
550 CHECK( x509_parse_int( p, 2, &time->min ) ); in mbedtls_x509_get_time()
552 CHECK( x509_parse_int( p, 2, &time->sec ) ); in mbedtls_x509_get_time()
553 if( len > 12 && *(*p)++ != 'Z' ) in mbedtls_x509_get_time()
565 (*p)++; in mbedtls_x509_get_time()
566 ret = mbedtls_asn1_get_len( p, end, &len ); in mbedtls_x509_get_time()
571 CHECK( x509_parse_int( p, 4, &time->year ) ); in mbedtls_x509_get_time()
572 CHECK( x509_parse_int( p, 2, &time->mon ) ); in mbedtls_x509_get_time()
573 CHECK( x509_parse_int( p, 2, &time->day ) ); in mbedtls_x509_get_time()
574 CHECK( x509_parse_int( p, 2, &time->hour ) ); in mbedtls_x509_get_time()
575 CHECK( x509_parse_int( p, 2, &time->min ) ); in mbedtls_x509_get_time()
577 CHECK( x509_parse_int( p, 2, &time->sec ) ); in mbedtls_x509_get_time()
578 if( len > 14 && *(*p)++ != 'Z' ) in mbedtls_x509_get_time()
590 int mbedtls_x509_get_sig( unsigned char **p, const unsigned char *end, mbedtls_x509_buf *sig ) in mbedtls_x509_get_sig() argument
596 if( ( end - *p ) < 1 ) in mbedtls_x509_get_sig()
600 tag_type = **p; in mbedtls_x509_get_sig()
602 if( ( ret = mbedtls_asn1_get_bitstring_null( p, end, &len ) ) != 0 ) in mbedtls_x509_get_sig()
607 sig->p = *p; in mbedtls_x509_get_sig()
609 *p += len; in mbedtls_x509_get_sig()
666 int mbedtls_x509_get_ext( unsigned char **p, const unsigned char *end, in mbedtls_x509_get_ext() argument
672 if( *p == end ) in mbedtls_x509_get_ext()
675 ext->tag = **p; in mbedtls_x509_get_ext()
677 if( ( ret = mbedtls_asn1_get_tag( p, end, &ext->len, in mbedtls_x509_get_ext()
681 ext->p = *p; in mbedtls_x509_get_ext()
682 end = *p + ext->len; in mbedtls_x509_get_ext()
692 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in mbedtls_x509_get_ext()
696 if( end != *p + len ) in mbedtls_x509_get_ext()
714 char s[MBEDTLS_X509_MAX_DN_NAME_SIZE], *p; in mbedtls_x509_dn_gets() local
719 p = buf; in mbedtls_x509_dn_gets()
724 if( !name->oid.p ) in mbedtls_x509_dn_gets()
732 ret = mbedtls_snprintf( p, n, merge ? " + " : ", " ); in mbedtls_x509_dn_gets()
739 ret = mbedtls_snprintf( p, n, "%s=", short_name ); in mbedtls_x509_dn_gets()
741 ret = mbedtls_snprintf( p, n, "\?\?=" ); in mbedtls_x509_dn_gets()
749 c = name->val.p[i]; in mbedtls_x509_dn_gets()
755 ret = mbedtls_snprintf( p, n, "%s", s ); in mbedtls_x509_dn_gets()
773 char *p; in mbedtls_x509_serial_gets() local
775 p = buf; in mbedtls_x509_serial_gets()
783 if( i == 0 && nr > 1 && serial->p[i] == 0x0 ) in mbedtls_x509_serial_gets()
786 ret = mbedtls_snprintf( p, n, "%02X%s", in mbedtls_x509_serial_gets()
787 serial->p[i], ( i < nr - 1 ) ? ":" : "" ); in mbedtls_x509_serial_gets()
793 ret = mbedtls_snprintf( p, n, "...." ); in mbedtls_x509_serial_gets()
808 char *p = buf; in mbedtls_x509_sig_alg_gets() local
814 ret = mbedtls_snprintf( p, n, "???" ); in mbedtls_x509_sig_alg_gets()
816 ret = mbedtls_snprintf( p, n, "%s", desc ); in mbedtls_x509_sig_alg_gets()
830 ret = mbedtls_snprintf( p, n, " (%s, MGF1-%s, 0x%02X)", in mbedtls_x509_sig_alg_gets()
850 char *p = buf; in mbedtls_x509_key_size_helper() local
854 ret = mbedtls_snprintf( p, n, "%s key size", name ); in mbedtls_x509_key_size_helper()