mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 13:25:42 +01:00
Add single function to parse ASN.1 AlgorithmIdentifier to x509.c
This commit is contained in:
parent
1898b68f09
commit
b59d3f1692
@ -305,6 +305,10 @@ int mbedtls_x509_get_rsassa_pss_params( const mbedtls_x509_buf *params,
|
||||
int *salt_len );
|
||||
#endif
|
||||
int mbedtls_x509_get_sig( unsigned char **p, const unsigned char *end, mbedtls_x509_buf *sig );
|
||||
int mbedtls_x509_get_sig_alg_raw( unsigned char **p, unsigned char const *end,
|
||||
mbedtls_md_type_t *md_alg,
|
||||
mbedtls_pk_type_t *pk_alg,
|
||||
void **sig_opts );
|
||||
int mbedtls_x509_get_sig_alg( const mbedtls_x509_buf *sig_oid, const mbedtls_x509_buf *sig_params,
|
||||
mbedtls_md_type_t *md_alg, mbedtls_pk_type_t *pk_alg,
|
||||
void **sig_opts );
|
||||
|
@ -802,6 +802,21 @@ int mbedtls_x509_get_sig( unsigned char **p, const unsigned char *end, mbedtls_x
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
int mbedtls_x509_get_sig_alg_raw( unsigned char **p, unsigned char const *end,
|
||||
mbedtls_md_type_t *md_alg,
|
||||
mbedtls_pk_type_t *pk_alg,
|
||||
void **sig_opts )
|
||||
{
|
||||
int ret;
|
||||
mbedtls_asn1_buf alg, params;
|
||||
ret = mbedtls_asn1_get_alg( p, end, &alg, ¶ms );
|
||||
if( ret != 0 )
|
||||
return( MBEDTLS_ERR_X509_INVALID_ALG + ret );
|
||||
|
||||
return( mbedtls_x509_get_sig_alg( &alg, ¶ms, md_alg,
|
||||
pk_alg, sig_opts ) );
|
||||
}
|
||||
|
||||
/*
|
||||
* Get signature algorithm from alg OID and optional parameters
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user