From 9a511c5bdf9e41795a6cef4a29aff6b74b97c857 Mon Sep 17 00:00:00 2001 From: Przemek Stekiel Date: Tue, 3 Jan 2023 10:23:13 +0100 Subject: [PATCH] Rename back mbedtls_x509_parse_general_name->mbedtls_x509_parse_subject_alt_name Signed-off-by: Przemek Stekiel --- include/mbedtls/x509_crt.h | 4 ++-- library/x509_crt.c | 8 ++++---- tests/suites/test_suite_x509parse.function | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/mbedtls/x509_crt.h b/include/mbedtls/x509_crt.h index 42ae671a5..cd089ce70 100644 --- a/include/mbedtls/x509_crt.h +++ b/include/mbedtls/x509_crt.h @@ -588,8 +588,8 @@ int mbedtls_x509_crt_parse_path(mbedtls_x509_crt *chain, const char *path); * SAN type. * \return Another negative value for any other failure. */ -int mbedtls_x509_parse_general_name(const mbedtls_x509_buf *san_buf, - mbedtls_x509_subject_alternative_name *san); +int mbedtls_x509_parse_subject_alt_name(const mbedtls_x509_buf *san_buf, + mbedtls_x509_subject_alternative_name *san); #if !defined(MBEDTLS_X509_REMOVE_INFO) /** diff --git a/library/x509_crt.c b/library/x509_crt.c index 40bffb4c2..476c16245 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -685,7 +685,7 @@ static int x509_get_general_names(unsigned char **p, /* * Check that the SAN is structured correctly. */ - ret = mbedtls_x509_parse_general_name(&(cur->buf), &dummy_san_buf); + ret = mbedtls_x509_parse_subject_alt_name(&(cur->buf), &dummy_san_buf); /* * In case the extension is malformed, return an error, * and clear the allocated sequences. @@ -1798,7 +1798,7 @@ static int x509_info_subject_alt_name(char **buf, size_t *size, while (cur != NULL) { memset(&san, 0, sizeof(san)); - parse_ret = mbedtls_x509_parse_general_name(&cur->buf, &san); + parse_ret = mbedtls_x509_parse_subject_alt_name(&cur->buf, &san); if (parse_ret != 0) { if (parse_ret == MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE) { ret = mbedtls_snprintf(p, n, "\n%s ", prefix); @@ -1888,8 +1888,8 @@ static int x509_info_subject_alt_name(char **buf, size_t *size, return 0; } -int mbedtls_x509_parse_general_name(const mbedtls_x509_buf *san_buf, - mbedtls_x509_subject_alternative_name *san) +int mbedtls_x509_parse_subject_alt_name(const mbedtls_x509_buf *san_buf, + mbedtls_x509_subject_alternative_name *san) { int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED; switch (san_buf->tag & diff --git a/tests/suites/test_suite_x509parse.function b/tests/suites/test_suite_x509parse.function index 4f80b64e2..921b3fd8d 100644 --- a/tests/suites/test_suite_x509parse.function +++ b/tests/suites/test_suite_x509parse.function @@ -458,7 +458,7 @@ void x509_parse_san(char *crt_file, char *result_str, int parse_result) if (crt.ext_types & MBEDTLS_X509_EXT_SUBJECT_ALT_NAME) { cur = &crt.subject_alt_names; while (cur != NULL) { - ret = mbedtls_x509_parse_general_name(&cur->buf, &san); + ret = mbedtls_x509_parse_subject_alt_name(&cur->buf, &san); TEST_ASSERT(ret == 0 || ret == MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE); /* * If san type not supported, ignore.