Lines Matching refs:len

190     if( ( ret = mbedtls_asn1_get_tag( p, end, &params->len, params->tag ) ) != 0 )  in pk_get_ecparams()
196 *p += params->len; in pk_get_ecparams()
229 const unsigned char * const end = params->p + params->len; in pk_group_from_specified()
231 size_t len; in pk_group_from_specified() local
247 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in pk_group_from_specified()
251 end_field = p + len; in pk_group_from_specified()
261 if( ( ret = mbedtls_asn1_get_tag( &p, end_field, &len, MBEDTLS_ASN1_OID ) ) != 0 ) in pk_group_from_specified()
264 if( len != MBEDTLS_OID_SIZE( MBEDTLS_OID_ANSI_X9_62_PRIME_FIELD ) || in pk_group_from_specified()
265 memcmp( p, MBEDTLS_OID_ANSI_X9_62_PRIME_FIELD, len ) != 0 ) in pk_group_from_specified()
270 p += len; in pk_group_from_specified()
291 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in pk_group_from_specified()
295 end_curve = p + len; in pk_group_from_specified()
301 if( ( ret = mbedtls_asn1_get_tag( &p, end_curve, &len, MBEDTLS_ASN1_OCTET_STRING ) ) != 0 || in pk_group_from_specified()
302 ( ret = mbedtls_mpi_read_binary( &grp->A, p, len ) ) != 0 ) in pk_group_from_specified()
307 p += len; in pk_group_from_specified()
309 if( ( ret = mbedtls_asn1_get_tag( &p, end_curve, &len, MBEDTLS_ASN1_OCTET_STRING ) ) != 0 || in pk_group_from_specified()
310 ( ret = mbedtls_mpi_read_binary( &grp->B, p, len ) ) != 0 ) in pk_group_from_specified()
315 p += len; in pk_group_from_specified()
318 if( ( ret = mbedtls_asn1_get_tag( &p, end_curve, &len, MBEDTLS_ASN1_BIT_STRING ) ) == 0 ) in pk_group_from_specified()
319 p += len; in pk_group_from_specified()
328 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, MBEDTLS_ASN1_OCTET_STRING ) ) != 0 ) in pk_group_from_specified()
332 ( const unsigned char *) p, len ) ) != 0 ) in pk_group_from_specified()
340 len != mbedtls_mpi_size( &grp->P ) + 1 || in pk_group_from_specified()
341 mbedtls_mpi_read_binary( &grp->G.X, p + 1, len - 1 ) != 0 || in pk_group_from_specified()
349 p += len; in pk_group_from_specified()
513 size_t len; in pk_get_rsapubkey() local
515 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in pk_get_rsapubkey()
519 if( *p + len != end ) in pk_get_rsapubkey()
534 rsa->len = mbedtls_mpi_size( &rsa->N ); in pk_get_rsapubkey()
566 params->len != 0 ) ) in pk_get_pk_alg()
583 size_t len; in mbedtls_pk_parse_subpubkey() local
588 if( ( ret = mbedtls_asn1_get_tag( p, end, &len, in mbedtls_pk_parse_subpubkey()
594 end = *p + len; in mbedtls_pk_parse_subpubkey()
599 if( ( ret = mbedtls_asn1_get_bitstring_null( p, end, &len ) ) != 0 ) in mbedtls_pk_parse_subpubkey()
602 if( *p + len != end ) in mbedtls_pk_parse_subpubkey()
647 size_t len; in pk_parse_key_pkcs1_der() local
669 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in pk_parse_key_pkcs1_der()
675 end = p + len; in pk_parse_key_pkcs1_der()
700 rsa->len = mbedtls_mpi_size( &rsa->N ); in pk_parse_key_pkcs1_der()
729 size_t len; in pk_parse_key_sec1_der() local
745 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in pk_parse_key_sec1_der()
751 end = p + len; in pk_parse_key_sec1_der()
759 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, MBEDTLS_ASN1_OCTET_STRING ) ) != 0 ) in pk_parse_key_sec1_der()
762 if( ( ret = mbedtls_mpi_read_binary( &eck->d, p, len ) ) != 0 ) in pk_parse_key_sec1_der()
768 p += len; in pk_parse_key_sec1_der()
776 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in pk_parse_key_sec1_der()
779 if( ( ret = pk_get_ecparams( &p, p + len, &params) ) != 0 || in pk_parse_key_sec1_der()
796 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in pk_parse_key_sec1_der()
799 end2 = p + len; in pk_parse_key_sec1_der()
801 if( ( ret = mbedtls_asn1_get_bitstring_null( &p, end2, &len ) ) != 0 ) in pk_parse_key_sec1_der()
804 if( p + len != end2 ) in pk_parse_key_sec1_der()
854 size_t len; in pk_parse_key_pkcs8_unencrypted_der() local
877 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in pk_parse_key_pkcs8_unencrypted_der()
883 end = p + len; in pk_parse_key_pkcs8_unencrypted_der()
894 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, MBEDTLS_ASN1_OCTET_STRING ) ) != 0 ) in pk_parse_key_pkcs8_unencrypted_der()
897 if( len < 1 ) in pk_parse_key_pkcs8_unencrypted_der()
910 if( ( ret = pk_parse_key_pkcs1_der( mbedtls_pk_rsa( *pk ), p, len ) ) != 0 ) in pk_parse_key_pkcs8_unencrypted_der()
921 ( ret = pk_parse_key_sec1_der( mbedtls_pk_ec( *pk ), p, len ) ) != 0 ) in pk_parse_key_pkcs8_unencrypted_der()
943 size_t len; in pk_parse_key_pkcs8_encrypted_der() local
974 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, in pk_parse_key_pkcs8_encrypted_der()
980 end = p + len; in pk_parse_key_pkcs8_encrypted_der()
985 if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, MBEDTLS_ASN1_OCTET_STRING ) ) != 0 ) in pk_parse_key_pkcs8_encrypted_der()
988 if( len > sizeof( buf ) ) in pk_parse_key_pkcs8_encrypted_der()
999 pwd, pwdlen, p, len, buf ) ) != 0 ) in pk_parse_key_pkcs8_encrypted_der()
1014 p, len, buf ) ) != 0 ) in pk_parse_key_pkcs8_encrypted_der()
1033 p, len, buf ) ) != 0 ) in pk_parse_key_pkcs8_encrypted_der()
1052 return( pk_parse_key_pkcs8_unencrypted_der( pk, buf, len ) ); in pk_parse_key_pkcs8_encrypted_der()
1067 size_t len; in mbedtls_pk_parse_key() local
1080 key, pwd, pwdlen, &len ); in mbedtls_pk_parse_key()
1113 key, pwd, pwdlen, &len ); in mbedtls_pk_parse_key()
1144 key, NULL, 0, &len ); in mbedtls_pk_parse_key()
1167 key, NULL, 0, &len ); in mbedtls_pk_parse_key()
1254 size_t len; in mbedtls_pk_parse_public_key() local
1266 key, NULL, 0, &len ); in mbedtls_pk_parse_public_key()