From a7f96309255ebf97d0ff3263eec7537a92c04cc1 Mon Sep 17 00:00:00 2001 From: Agathiyan Bragadeesh Date: Thu, 10 Aug 2023 16:03:27 +0100 Subject: [PATCH] Remove duplicate '+' in comparison string Signed-off-by: Agathiyan Bragadeesh --- library/x509.c | 2 +- library/x509_create.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/x509.c b/library/x509.c index e2bb2fd9c..b487b43cf 100644 --- a/library/x509.c +++ b/library/x509.c @@ -910,7 +910,7 @@ int mbedtls_x509_dn_gets(char *buf, size_t size, const mbedtls_x509_name *dn) c = name->val.p[i]; // Special characters requiring escaping, RFC 4514 Section 2.4 if (c) { - if (strchr(",=+<>;\"\\+", c) || + if (strchr(",=+<>;\"\\", c) || ((i == 0) && strchr("# ", c)) || ((i == name->val.len-1) && (c == ' '))) { if (j + 1 >= sizeof(s) - 1) { diff --git a/library/x509_create.c b/library/x509_create.c index a666e2d22..4c5261113 100644 --- a/library/x509_create.c +++ b/library/x509_create.c @@ -197,7 +197,7 @@ static int parse_attribute_value_string(const char *s, hexpair = 1; *(d++) = n; c++; - } else if (c == end || !strchr(" ,=+<>#;\"\\+", *c)) { + } else if (c == end || !strchr(" ,=+<>#;\"\\", *c)) { return MBEDTLS_ERR_X509_INVALID_NAME; } }