mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Fix code style
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
This commit is contained in:
@ -867,8 +867,7 @@ int mbedtls_x509_dn_gets(char *buf, size_t size, const mbedtls_x509_name *dn)
|
|||||||
print_hexstring = 1;
|
print_hexstring = 1;
|
||||||
} else if (ret == MBEDTLS_ERR_OID_BUF_TOO_SMALL) {
|
} else if (ret == MBEDTLS_ERR_OID_BUF_TOO_SMALL) {
|
||||||
return MBEDTLS_ERR_X509_BUFFER_TOO_SMALL;
|
return MBEDTLS_ERR_X509_BUFFER_TOO_SMALL;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ret = mbedtls_snprintf(p, n, "\?\?=");
|
ret = mbedtls_snprintf(p, n, "\?\?=");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -879,11 +878,11 @@ int mbedtls_x509_dn_gets(char *buf, size_t size, const mbedtls_x509_name *dn)
|
|||||||
s[0] = '#';
|
s[0] = '#';
|
||||||
|
|
||||||
asn1_len_p = asn1_tag_len_buf + 10;
|
asn1_len_p = asn1_tag_len_buf + 10;
|
||||||
if((ret = mbedtls_asn1_write_len(&asn1_len_p, asn1_tag_len_buf, name->val.len)) < 0) {
|
if ((ret = mbedtls_asn1_write_len(&asn1_len_p, asn1_tag_len_buf, name->val.len)) < 0) {
|
||||||
return MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
return MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||||
}
|
}
|
||||||
asn1_len_size = ret;
|
asn1_len_size = ret;
|
||||||
if((ret = mbedtls_asn1_write_tag(&asn1_len_p, asn1_tag_len_buf, name->val.tag)) < 0) {
|
if ((ret = mbedtls_asn1_write_tag(&asn1_len_p, asn1_tag_len_buf, name->val.tag)) < 0) {
|
||||||
return MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
return MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||||
}
|
}
|
||||||
asn1_tag_size = ret;
|
asn1_tag_size = ret;
|
||||||
@ -921,8 +920,7 @@ int mbedtls_x509_dn_gets(char *buf, size_t size, const mbedtls_x509_name *dn)
|
|||||||
// Special characters requiring escaping, RFC 4514 Section 2.4
|
// Special characters requiring escaping, RFC 4514 Section 2.4
|
||||||
if (c == '\0') {
|
if (c == '\0') {
|
||||||
return MBEDTLS_ERR_X509_INVALID_NAME;
|
return MBEDTLS_ERR_X509_INVALID_NAME;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (strchr(",=+<>;\"\\", c) ||
|
if (strchr(",=+<>;\"\\", c) ||
|
||||||
((i == 0) && strchr("# ", c)) ||
|
((i == 0) && strchr("# ", c)) ||
|
||||||
((i == name->val.len-1) && (c == ' '))) {
|
((i == name->val.len-1) && (c == ' '))) {
|
||||||
|
@ -276,20 +276,19 @@ int mbedtls_x509_string_to_names(mbedtls_asn1_named_data **head, const char *nam
|
|||||||
if (*s == '#') {
|
if (*s == '#') {
|
||||||
#if defined(MBEDTLS_ASN1_PARSE_C)
|
#if defined(MBEDTLS_ASN1_PARSE_C)
|
||||||
if ((parse_ret =
|
if ((parse_ret =
|
||||||
parse_attribute_value_der_encoded(s, (int) (c - s), data, &data_len,
|
parse_attribute_value_der_encoded(s, (int) (c - s), data, &data_len,
|
||||||
&tag)) != 0) {
|
&tag)) != 0) {
|
||||||
mbedtls_free(oid.p);
|
mbedtls_free(oid.p);
|
||||||
return MBEDTLS_ERR_X509_INVALID_NAME;
|
return MBEDTLS_ERR_X509_INVALID_NAME;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
return MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE
|
return MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
if(numericoid) {
|
if (numericoid) {
|
||||||
mbedtls_free(oid.p);
|
mbedtls_free(oid.p);
|
||||||
return MBEDTLS_ERR_X509_INVALID_NAME;
|
return MBEDTLS_ERR_X509_INVALID_NAME;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if ((parse_ret =
|
if ((parse_ret =
|
||||||
parse_attribute_value_string(s, (int) (c - s), data,
|
parse_attribute_value_string(s, (int) (c - s), data,
|
||||||
&data_len)) != 0) {
|
&data_len)) != 0) {
|
||||||
|
Reference in New Issue
Block a user