Use generated certs in DER format in tests

Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
Przemek Stekiel
2023-04-06 09:23:25 +02:00
parent 5ff986cb0a
commit 2568d47916
2 changed files with 13 additions and 13 deletions

View File

@@ -1550,14 +1550,14 @@ exit:
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_X509_CRT_PARSE_C */
void x509_crt_parse_subjectkeyid(data_t *buf, int subjectKeyIdLength_arg, int ref_ret)
void x509_crt_parse_subjectkeyid(char *file, int subjectKeyIdLength, int ref_ret)
{
size_t subjectKeyIdLength = subjectKeyIdLength_arg;
mbedtls_x509_crt crt;
mbedtls_x509_crt_init(&crt);
TEST_ASSERT(mbedtls_x509_crt_parse_der(&crt, buf->x, buf->len) == ref_ret);
TEST_ASSERT(mbedtls_x509_crt_parse_file(&crt, file) == ref_ret);
if (ref_ret == 0) {
TEST_ASSERT(crt.subject_key_id.tag == MBEDTLS_ASN1_OCTET_STRING);
@@ -1573,8 +1573,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_X509_CRT_PARSE_C */
void x509_crt_parse_authoritykeyid(data_t *buf,
int keyIdLength_arg,
void x509_crt_parse_authoritykeyid(char *file,
int keyIdLength,
char *authorityKeyId_issuer,
int serialLength_arg,
int ref_ret)
@@ -1590,7 +1590,7 @@ void x509_crt_parse_authoritykeyid(data_t *buf,
mbedtls_x509_crt_init(&crt);
TEST_ASSERT(mbedtls_x509_crt_parse_der(&crt, buf->x, buf->len) == ref_ret);
TEST_ASSERT(mbedtls_x509_crt_parse_file(&crt, file) == ref_ret);
if (ref_ret == 0) {
/* KeyId test */