summaryrefslogtreecommitdiff
path: root/lib/algorithms/ecc.c
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2018-09-27 21:11:21 +0200
committerTim Rühsen <tim.ruehsen@gmx.de>2018-09-27 21:15:58 +0200
commit65f0988f74fa4a6c2ff474f0b63ea928c1cde929 (patch)
tree41bd236c96ac482e2a60e455248678c61cb84e16 /lib/algorithms/ecc.c
parentc9c4523eaddbfd8e7fb7855e31de4f1d88ec1c06 (diff)
downloadgnutls-65f0988f74fa4a6c2ff474f0b63ea928c1cde929.tar.gz
Use ASCII version of strcasecmp() in library codetmp-lib-c-strcase
strcasecmp() has side effects in some locales. What we really need is c_strcasecmp() from Gnulib for comparing ASCII strings. Fixes #570 Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
Diffstat (limited to 'lib/algorithms/ecc.c')
-rw-r--r--lib/algorithms/ecc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/algorithms/ecc.c b/lib/algorithms/ecc.c
index 7537708d90..9777ac2337 100644
--- a/lib/algorithms/ecc.c
+++ b/lib/algorithms/ecc.c
@@ -25,6 +25,7 @@
#include "errors.h"
#include <x509/common.h>
#include <pk.h>
+#include "c-strcase.h"
/* Supported ECC curves
*/
@@ -161,7 +162,7 @@ const gnutls_ecc_curve_t *gnutls_ecc_curve_list(void)
int i = 0;
GNUTLS_ECC_CURVE_LOOP(
- if (_gnutls_pk_curve_exists(p->id))
+ if (_gnutls_pk_curve_exists(p->id))
supported_curves[i++] = p->id;
);
supported_curves[i++] = 0;
@@ -184,7 +185,7 @@ gnutls_ecc_curve_t gnutls_oid_to_ecc_curve(const char *oid)
gnutls_ecc_curve_t ret = GNUTLS_ECC_CURVE_INVALID;
GNUTLS_ECC_CURVE_LOOP(
- if (p->oid != NULL && strcasecmp(p->oid, oid) == 0 && _gnutls_pk_curve_exists(p->id)) {
+ if (p->oid != NULL && c_strcasecmp(p->oid, oid) == 0 && _gnutls_pk_curve_exists(p->id)) {
ret = p->id;
break;
}
@@ -209,7 +210,7 @@ gnutls_ecc_curve_t gnutls_ecc_curve_get_id(const char *name)
gnutls_ecc_curve_t ret = GNUTLS_ECC_CURVE_INVALID;
GNUTLS_ECC_CURVE_LOOP(
- if (strcasecmp(p->name, name) == 0 && _gnutls_pk_curve_exists(p->id)) {
+ if (c_strcasecmp(p->name, name) == 0 && _gnutls_pk_curve_exists(p->id)) {
ret = p->id;
break;
}
@@ -304,7 +305,7 @@ const char *gnutls_ecc_curve_get_oid(gnutls_ecc_curve_t curve)
GNUTLS_ECC_CURVE_LOOP(
if (p->id == curve) {
- ret = p->oid;
+ ret = p->oid;
break;
}
);