summaryrefslogtreecommitdiff
path: root/trust
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2018-05-24 11:01:33 +0200
committerDaiki Ueno <ueno@gnu.org>2018-05-25 12:50:54 +0200
commit117b35db99af4331daad4279eadfb9280e0c1325 (patch)
tree981b85e10f2b1606f57386b2272e793eeb799331 /trust
parente42dcf5283a5537c196147c9a2468ee537b9da7b (diff)
common: Make case conversion locale independent
The tolower()/toupper() functions take into account of the current locale settings, which p11-kit doesn't want. Add replacement functions that work as if they are called under the C locale.
Diffstat (limited to 'trust')
-rw-r--r--trust/extract-jks.c2
-rw-r--r--trust/extract-openssl.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/trust/extract-jks.c b/trust/extract-jks.c
index 1ba37c1..e1f1340 100644
--- a/trust/extract-jks.c
+++ b/trust/extract-jks.c
@@ -159,7 +159,7 @@ convert_alias (const char *input,
for (i = 0; i < length; i++) {
ch = input[i];
if (!isspace (ch) && (ch & 0x80) == 0) {
- ch = tolower (ch);
+ ch = p11_ascii_tolower (ch);
p11_buffer_add (buf, &ch, 1);
}
}
diff --git a/trust/extract-openssl.c b/trust/extract-openssl.c
index 5f72076..0a56d3f 100644
--- a/trust/extract-openssl.c
+++ b/trust/extract-openssl.c
@@ -395,7 +395,7 @@ p11_openssl_canon_string (char *str,
/* If there has been a space, then add one */
if (sp)
*out++ = ' ';
- *out++ = (*in & 0x80) ? *in : tolower (*in);
+ *out++ = (*in & 0x80) ? *in : p11_ascii_tolower (*in);
sp = false;
nsp = true;
/* If there has been a non-space, then note we should get one */