Parse signatureAlgorithm of OCSP response

Populate the function x509_ocsp_get_sig_alg() that parses the
signatureAlgorithm from the BasicOCSPResponse ASN.1 structure. The
parsing is actually done by the preexisting functions:

    * mbedtls_x509_get_alg()
    * mbedtls_x509_get_sig_alg()
This commit is contained in:
Andres Amaya Garcia
2017-08-25 12:50:48 +01:00
committed by Andres Amaya Garcia
parent 647a62133d
commit 77c0c8e9a2

View File

@@ -763,6 +763,22 @@ static int x509_ocsp_get_sig_alg( mbedtls_x509_ocsp_response *resp,
unsigned char **p,
const unsigned char *end )
{
int ret;
mbedtls_x509_buf sig_params;
if( ( ret = mbedtls_x509_get_alg( p, end, &resp->sig_oid,
&sig_params ) ) != 0 )
{
return( ret );
}
if( ( ret = mbedtls_x509_get_sig_alg( &resp->sig_oid, &sig_params,
&resp->sig_md, &resp->sig_pk,
&resp->sig_opts ) ) != 0 )
{
return( ret );
}
return( 0 );
}