Change the name of the temporary san variable

Explain why it is used.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
Andrzej Kurek 2023-04-30 14:11:49 -04:00 committed by David Horstmann
parent 1747304a7a
commit 154a605ae8

View file

@ -1215,9 +1215,9 @@ int mbedtls_x509_get_subject_alt_name_ext(unsigned char **p,
mbedtls_asn1_sequence *cur = subject_alt_name; mbedtls_asn1_sequence *cur = subject_alt_name;
while (*p < end) { while (*p < end) {
mbedtls_x509_subject_alternative_name dummy_san_buf; mbedtls_x509_subject_alternative_name tmp_san_name;
mbedtls_x509_buf tmp_san_buf; mbedtls_x509_buf tmp_san_buf;
memset(&dummy_san_buf, 0, sizeof(dummy_san_buf)); memset(&tmp_san_name, 0, sizeof(tmp_san_name));
tmp_san_buf.tag = **p; tmp_san_buf.tag = **p;
(*p)++; (*p)++;
@ -1236,9 +1236,10 @@ int mbedtls_x509_get_subject_alt_name_ext(unsigned char **p,
} }
/* /*
* Check that the SAN is structured correctly. * Check that the SAN is structured correctly by parsing it.
* The SAN structure is discarded afterwards.
*/ */
ret = mbedtls_x509_parse_subject_alt_name(&tmp_san_buf, &dummy_san_buf); ret = mbedtls_x509_parse_subject_alt_name(&tmp_san_buf, &tmp_san_name);
/* /*
* In case the extension is malformed, return an error, * In case the extension is malformed, return an error,
* and clear the allocated sequences. * and clear the allocated sequences.
@ -1249,7 +1250,7 @@ int mbedtls_x509_get_subject_alt_name_ext(unsigned char **p,
return ret; return ret;
} }
mbedtls_x509_free_subject_alt_name(&dummy_san_buf); mbedtls_x509_free_subject_alt_name(&tmp_san_name);
/* Allocate and assign next pointer */ /* Allocate and assign next pointer */
if (cur->buf.p != NULL) { if (cur->buf.p != NULL) {
if (cur->next != NULL) { if (cur->next != NULL) {
@ -1439,7 +1440,7 @@ int mbedtls_x509_parse_subject_alt_name(const mbedtls_x509_buf *san_buf,
break; break;
/* /*
* RFC822 Name * rfc822Name
*/ */
case (MBEDTLS_ASN1_CONTEXT_SPECIFIC | MBEDTLS_X509_SAN_RFC822_NAME): case (MBEDTLS_ASN1_CONTEXT_SPECIFIC | MBEDTLS_X509_SAN_RFC822_NAME):
{ {