mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-04-16 17:08:48 +02:00
Rename the following functions in x509_ocsp.h and x509_ocsp.c to fit the calling convention in other X.509 components (e.g CRL and CRT): * mbedtls_x509_ocsp_parse_response -> mbedtls_x509_ocsp_response_parse * mbedtls_x509_ocsp_parse_response_file -> mbedtls_x509_ocsp_response_parse_file
39 lines
1.0 KiB
Plaintext
39 lines
1.0 KiB
Plaintext
/* BEGIN_HEADER */
|
|
#include "mbedtls/x509.h"
|
|
#include "mbedtls/x509_ocsp.h"
|
|
/* END_HEADER */
|
|
|
|
/* BEGIN_DEPENDENCIES
|
|
* depends_on:MBEDTLS_X509_OCSP_PARSE_C
|
|
* END_DEPENDENCIES
|
|
*/
|
|
|
|
/* BEGIN_CASE */
|
|
void x509parse_ocsp_response( char *resp_data, char *result_str, int result )
|
|
{
|
|
mbedtls_x509_ocsp_response resp;
|
|
unsigned char resp_der[3000];
|
|
char resp_info[2000];
|
|
int data_len, ret;
|
|
|
|
mbedtls_x509_ocsp_response_init( &resp );
|
|
memset( resp_der, 0, sizeof( resp_der ) );
|
|
memset( resp_info, 0, sizeof( resp_info ) );
|
|
|
|
data_len = unhexify( resp_der, resp_data );
|
|
|
|
TEST_ASSERT( mbedtls_x509_ocsp_response_parse( &resp, resp_der,
|
|
data_len ) == result );
|
|
if( result == 0 )
|
|
{
|
|
ret = mbedtls_x509_ocsp_response_info( resp_info, sizeof( resp_info ),
|
|
"", &resp );
|
|
TEST_ASSERT( ret >= 0 );
|
|
TEST_ASSERT( strcmp( result_str, resp_info ) == 0 );
|
|
}
|
|
|
|
exit:
|
|
mbedtls_x509_ocsp_response_free( &resp );
|
|
}
|
|
/* END_CASE */
|