diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-08-04 14:49:21 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-08-06 17:47:14 +0200 |
commit | 13fac76a71f25631d7415ba457bdab267d0950d4 (patch) | |
tree | 76914bbdca93094302783c211f539ff5c6c1bdd0 /src/pubkey.c | |
parent | pubkey: isblank is a subset of isspace (diff) | |
download | wireguard-tools-13fac76a71f25631d7415ba457bdab267d0950d4.tar.xz wireguard-tools-13fac76a71f25631d7415ba457bdab267d0950d4.zip |
ctype: use non-locale-specific ctype.h
We also make these constant time, even though we're never distinguishing
between bits of a secret using them. From that perspective, though, this
is markedly better than the locale-specific table lookups in glibc, even
though base64 characters span two cache lines and valid private keys
must hit both.
Co-authored-by: Samuel Neves <sneves@dei.uc.pt>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Samuel Neves <sneves@dei.uc.pt>
Diffstat (limited to 'src/pubkey.c')
-rw-r--r-- | src/pubkey.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pubkey.c b/src/pubkey.c index a78fe11..b4478dc 100644 --- a/src/pubkey.c +++ b/src/pubkey.c @@ -5,11 +5,11 @@ #include <errno.h> #include <stdio.h> -#include <ctype.h> #include "curve25519.h" #include "encoding.h" #include "subcommands.h" +#include "ctype.h" int pubkey_main(int argc, char *argv[]) { @@ -31,7 +31,7 @@ int pubkey_main(int argc, char *argv[]) for (;;) { trailing_char = getc(stdin); - if (!trailing_char || isspace(trailing_char)) + if (!trailing_char || char_is_space(trailing_char)) continue; if (trailing_char == EOF) break; |