1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

Add asn1 write tag and len to x509 use c config

Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
This commit is contained in:
Agathiyan Bragadeesh
2023-09-04 14:53:30 +01:00
parent a2423debcc
commit 86dc08599b
3 changed files with 8 additions and 7 deletions

View File

@@ -43,9 +43,7 @@
#include "mbedtls/pem.h"
#endif
#if defined(MBEDTLS_ASN1_WRITE_C)
#include "mbedtls/asn1write.h"
#endif
#include "mbedtls/platform.h"
@@ -874,7 +872,6 @@ int mbedtls_x509_dn_gets(char *buf, size_t size, const mbedtls_x509_name *dn)
MBEDTLS_X509_SAFE_SNPRINTF;
if (print_hexstring) {
#if defined(MBEDTLS_ASN1_WRITE_C)
s[0] = '#';
asn1_len_p = asn1_tag_len_buf + 10;
@@ -907,9 +904,6 @@ int mbedtls_x509_dn_gets(char *buf, size_t size, const mbedtls_x509_name *dn)
s[j++] = nibble_to_hex_digit(highbits);
s[j++] = nibble_to_hex_digit(lowbits);
}
#else
return MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE;
#endif
} else {
for (i = 0, j = 0; i < name->val.len; i++, j++) {
if (j >= sizeof(s) - 1) {