summaryrefslogtreecommitdiffstats
path: root/lib/libskey
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2013-11-29 19:00:50 +0000
committerderaadt <deraadt@openbsd.org>2013-11-29 19:00:50 +0000
commit80c62621bb25d2491e07ab57f489fdca1ee0d448 (patch)
tree01dd28d9a1e9f248b9742f6e236b4d071b5e9e49 /lib/libskey
parentDon't try to reuse _initial_thread in the fork() wrapper, as the (diff)
downloadwireguard-openbsd-80c62621bb25d2491e07ab57f489fdca1ee0d448.tar.xz
wireguard-openbsd-80c62621bb25d2491e07ab57f489fdca1ee0d448.zip
fairly simple unsigned char casts for ctype
ok krw
Diffstat (limited to 'lib/libskey')
-rw-r--r--lib/libskey/put.c8
-rw-r--r--lib/libskey/skeylogin.c13
-rw-r--r--lib/libskey/skeysubr.c6
3 files changed, 14 insertions, 13 deletions
diff --git a/lib/libskey/put.c b/lib/libskey/put.c
index 1177a364a65..85d00f6892c 100644
--- a/lib/libskey/put.c
+++ b/lib/libskey/put.c
@@ -8,7 +8,7 @@
*
* Dictionary lookup and extraction.
*
- * $OpenBSD: put.c,v 1.13 2003/04/03 17:48:50 millert Exp $
+ * $OpenBSD: put.c,v 1.14 2013/11/29 19:00:51 deraadt Exp $
*/
#include <stdio.h>
@@ -492,10 +492,10 @@ static void
standard(char *word)
{
while (*word) {
- if (!isascii(*word))
+ if (!isascii((unsigned char)*word))
break;
- if (islower(*word))
- *word = toupper(*word);
+ if (islower((unsigned char)*word))
+ *word = toupper((unsigned char)*word);
if (*word == '1')
*word = 'L';
if (*word == '0')
diff --git a/lib/libskey/skeylogin.c b/lib/libskey/skeylogin.c
index 74f26346cc8..bd4a97cc3ca 100644
--- a/lib/libskey/skeylogin.c
+++ b/lib/libskey/skeylogin.c
@@ -10,7 +10,7 @@
*
* S/Key verification check, lookups, and authentication.
*
- * $OpenBSD: skeylogin.c,v 1.54 2007/03/20 03:40:06 tedu Exp $
+ * $OpenBSD: skeylogin.c,v 1.55 2013/11/29 19:00:51 deraadt Exp $
*/
#include <sys/param.h>
@@ -141,7 +141,7 @@ skeygetent(int fd, struct skey *mp, const char *name)
mp->keyfile = keyfile;
if ((nread = fread(mp->buf, 1, sizeof(mp->buf), keyfile)) == 0 ||
- !isspace(mp->buf[nread - 1]))
+ !isspace((unsigned char)mp->buf[nread - 1]))
goto bad_keyfile;
mp->buf[nread - 1] = '\0';
@@ -275,7 +275,7 @@ skeyverify(struct skey *mp, char *response)
*/
(void)fseek(mp->keyfile, 0L, SEEK_SET);
if ((nread = fread(mp->buf, 1, sizeof(mp->buf), mp->keyfile)) == 0 ||
- !isspace(mp->buf[nread - 1]))
+ !isspace((unsigned char)mp->buf[nread - 1]))
goto verify_failure;
if ((mp->logname = strtok_r(mp->buf, " \t\r\n", &last)) == NULL)
goto verify_failure;
@@ -430,9 +430,10 @@ skey_fakeprompt(char *username, char *skeyprompt)
if (gethostname(pbuf, sizeof(pbuf)) == -1)
*(p = pbuf) = '.';
else
- for (p = pbuf; isalnum(*p); p++)
- if (isalpha(*p) && isupper(*p))
- *p = (char)tolower(*p);
+ for (p = pbuf; isalnum((unsigned char)*p); p++)
+ if (isalpha((unsigned char)*p) &&
+ isupper((unsigned char)*p))
+ *p = (char)tolower((unsigned char)*p);
if (*p && pbuf - p < 4)
(void)strncpy(p, "asjd", 4 - (pbuf - p));
pbuf[4] = '\0';
diff --git a/lib/libskey/skeysubr.c b/lib/libskey/skeysubr.c
index 079b2a0a136..4f2cb7e4a36 100644
--- a/lib/libskey/skeysubr.c
+++ b/lib/libskey/skeysubr.c
@@ -9,7 +9,7 @@
*
* S/Key misc routines.
*
- * $OpenBSD: skeysubr.c,v 1.30 2007/05/17 04:34:50 ray Exp $
+ * $OpenBSD: skeysubr.c,v 1.31 2013/11/29 19:00:51 deraadt Exp $
*/
#include <stdio.h>
@@ -481,7 +481,7 @@ lowcase(char *s)
char *p;
for (p = s; *p; p++) {
- if (isupper(*p))
- *p = (char)tolower(*p);
+ if (isupper((unsigned char)*p))
+ *p = (char)tolower((unsigned char)*p);
}
}