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/protocols.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/protocols.c')
-rw-r--r-- | lib/algorithms/protocols.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/algorithms/protocols.c b/lib/algorithms/protocols.c index f2277a9e28..501cf350c3 100644 --- a/lib/algorithms/protocols.c +++ b/lib/algorithms/protocols.c @@ -24,6 +24,7 @@ #include <algorithms.h> #include "errors.h" #include <x509/common.h> +#include "c-strcase.h" /* TLS Versions */ static const version_entry_st sup_versions[] = { @@ -242,7 +243,7 @@ const version_entry_st *_gnutls_version_lowest(gnutls_session_t session) return min_v; } -/* Returns the maximum version in the priorities +/* Returns the maximum version in the priorities */ const version_entry_st *_gnutls_version_max(gnutls_session_t session) { @@ -296,7 +297,7 @@ const version_entry_st *_gnutls_legacy_version_max(gnutls_session_t session) } /* Returns the number of bytes written to buffer or a negative - * error code. It will return GNUTLS_E_UNSUPPORTED_VERSION_PACKET + * error code. It will return GNUTLS_E_UNSUPPORTED_VERSION_PACKET * if there is no version >= TLS 1.3. */ int _gnutls_write_supported_versions(gnutls_session_t session, uint8_t *buffer, ssize_t buffer_size) @@ -411,7 +412,7 @@ gnutls_protocol_t gnutls_protocol_get_id(const char *name) gnutls_protocol_t ret = GNUTLS_VERSION_UNKNOWN; for (p = sup_versions; p->name != NULL; p++) { - if (strcasecmp(p->name, name) == 0) { + if (c_strcasecmp(p->name, name) == 0) { ret = p->id; break; } |