mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-08 17:42:09 +03:00
Add preprocessor config guards
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
This commit is contained in:
@@ -876,12 +876,15 @@ int mbedtls_x509_dn_gets(char *buf, size_t size, const mbedtls_x509_name *dn)
|
||||
}
|
||||
|
||||
if(is_numericoid) {
|
||||
#if defined(MBEDTLS_ASN1_WRITE_C)
|
||||
s[0] = '#';
|
||||
|
||||
c = name->val.tag;
|
||||
char lowbits = (c & 0x0F);
|
||||
char highbits = c>>4;
|
||||
s[1] = nibble_to_hex_digit(highbits);
|
||||
s[2] = nibble_to_hex_digit(lowbits);
|
||||
|
||||
asn1_len_p = asn1_len_buf+5;
|
||||
asn1_len_size = mbedtls_asn1_write_len(&asn1_len_p,asn1_len_buf,name->val.len);
|
||||
asn1_len_start = 5 - asn1_len_size;
|
||||
@@ -900,6 +903,9 @@ 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) {
|
||||
|
Reference in New Issue
Block a user