diff options
author | Tim Rühsen <tim.ruehsen@gmx.de> | 2018-09-27 21:11:21 +0200 |
---|---|---|
committer | Tim Rühsen <tim.ruehsen@gmx.de> | 2018-09-27 21:15:58 +0200 |
commit | 65f0988f74fa4a6c2ff474f0b63ea928c1cde929 (patch) | |
tree | 41bd236c96ac482e2a60e455248678c61cb84e16 /lib/algorithms/groups.c | |
parent | c9c4523eaddbfd8e7fb7855e31de4f1d88ec1c06 (diff) | |
download | gnutls-tmp-lib-c-strcase.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/groups.c')
-rw-r--r-- | lib/algorithms/groups.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/algorithms/groups.c b/lib/algorithms/groups.c index ccff59f098..70f0ee28c7 100644 --- a/lib/algorithms/groups.c +++ b/lib/algorithms/groups.c @@ -25,6 +25,7 @@ #include "errors.h" #include <x509/common.h> #include <pk.h> +#include "c-strcase.h" /* Supported ECC curves */ @@ -176,7 +177,7 @@ const gnutls_group_t *gnutls_group_list(void) int i = 0; GNUTLS_GROUP_LOOP( - if (p->curve == 0 || _gnutls_pk_curve_exists(p->curve)) + if (p->curve == 0 || _gnutls_pk_curve_exists(p->curve)) groups[i++] = p->id; ); groups[i++] = 0; @@ -201,7 +202,7 @@ gnutls_group_t gnutls_group_get_id(const char *name) gnutls_group_t ret = GNUTLS_GROUP_INVALID; GNUTLS_GROUP_LOOP( - if (strcasecmp(p->name, name) == 0 && ( + if (c_strcasecmp(p->name, name) == 0 && ( p->curve == 0 ||_gnutls_pk_curve_exists(p->curve))) { ret = p->id; break; |