mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Fix code style
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
This commit is contained in:
@ -876,7 +876,7 @@ int mbedtls_x509_dn_gets(char *buf, size_t size, const mbedtls_x509_name *dn)
|
|||||||
|
|
||||||
asn1_len_p = asn1_tag_len_buf + 10;
|
asn1_len_p = asn1_tag_len_buf + 10;
|
||||||
asn1_len_size = mbedtls_asn1_write_len(&asn1_len_p, asn1_tag_len_buf, name->val.len);
|
asn1_len_size = mbedtls_asn1_write_len(&asn1_len_p, asn1_tag_len_buf, name->val.len);
|
||||||
asn1_tag_size = mbedtls_asn1_write_tag(&asn1_len_p,asn1_tag_len_buf,name->val.tag);
|
asn1_tag_size = mbedtls_asn1_write_tag(&asn1_len_p, asn1_tag_len_buf, name->val.tag);
|
||||||
asn1_tag_len_buf_start = 10 - asn1_len_size - asn1_tag_size;
|
asn1_tag_len_buf_start = 10 - asn1_len_size - asn1_tag_size;
|
||||||
for (i = 0, j = 1; i < asn1_len_size + asn1_tag_size; i++) {
|
for (i = 0, j = 1; i < asn1_len_size + asn1_tag_size; i++) {
|
||||||
if (j + 1 >= sizeof(s) - 1) {
|
if (j + 1 >= sizeof(s) - 1) {
|
||||||
|
@ -139,7 +139,7 @@ static char *x509_oid_from_numericoid(const char *numericoid,
|
|||||||
|
|
||||||
ret = mbedtls_oid_from_numeric_string(oid_buf, numericoid, numericoid_len);
|
ret = mbedtls_oid_from_numeric_string(oid_buf, numericoid, numericoid_len);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
if(ret != MBEDTLS_ERR_ASN1_ALLOC_FAILED) {
|
if (ret != MBEDTLS_ERR_ASN1_ALLOC_FAILED) {
|
||||||
mbedtls_free(oid_buf->p);
|
mbedtls_free(oid_buf->p);
|
||||||
}
|
}
|
||||||
mbedtls_free(oid_buf);
|
mbedtls_free(oid_buf);
|
||||||
@ -187,7 +187,7 @@ static int parse_attribute_value_string(const char *s,
|
|||||||
|
|
||||||
/* Check for valid escaped characters in RFC 4514 in Section 3*/
|
/* Check for valid escaped characters in RFC 4514 in Section 3*/
|
||||||
if (c + 1 < end && (n = hexpair_to_int(*c, *(c+1))) != -1) {
|
if (c + 1 < end && (n = hexpair_to_int(*c, *(c+1))) != -1) {
|
||||||
if(n == 0) {
|
if (n == 0) {
|
||||||
return MBEDTLS_ERR_X509_INVALID_NAME;
|
return MBEDTLS_ERR_X509_INVALID_NAME;
|
||||||
}
|
}
|
||||||
hexpair = 1;
|
hexpair = 1;
|
||||||
@ -283,7 +283,7 @@ int mbedtls_x509_string_to_names(mbedtls_asn1_named_data **head, const char *nam
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
oid = malloc(strlen(attr_descr->oid));
|
oid = malloc(strlen(attr_descr->oid));
|
||||||
strcpy(oid,attr_descr->oid);
|
strcpy(oid, attr_descr->oid);
|
||||||
numericoid = 0;
|
numericoid = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,12 +296,12 @@ int mbedtls_x509_string_to_names(mbedtls_asn1_named_data **head, const char *nam
|
|||||||
if ((parse_ret =
|
if ((parse_ret =
|
||||||
parse_attribute_value_ber_encoded(s, (int) (c - s), data, &data_len,
|
parse_attribute_value_ber_encoded(s, (int) (c - s), data, &data_len,
|
||||||
&tag)) != 0) {
|
&tag)) != 0) {
|
||||||
if(numericoid) {
|
if (numericoid) {
|
||||||
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, &data_len)) != 0) {
|
parse_attribute_value_string(s, (int) (c - s), data,
|
||||||
|
&data_len)) != 0) {
|
||||||
return parse_ret;
|
return parse_ret;
|
||||||
}
|
}
|
||||||
tag = attr_descr->default_tag;
|
tag = attr_descr->default_tag;
|
||||||
|
Reference in New Issue
Block a user