pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

nss-hg: fix some ctype(3) issues and add missing includes in two files.



Module Name:	pkgsrc-wip
Committed By:	Thomas Klausner <wiz%NetBSD.org@localhost>
Pushed By:	wiz
Date:		Sat Jan 30 13:42:13 2016 +0100
Changeset:	1b1dadb280f609f1e4bc99d64c676c1863d359f8

Modified Files:
	nss-hg/distinfo
Added Files:
	nss-hg/patches/patch-cmd_fipstest_fipstest.c
	nss-hg/patches/patch-cmd_lib_basicutil.c
	nss-hg/patches/patch-lib_certdb_alg1485.c
	nss-hg/patches/patch-lib_certdb_certdb.c
	nss-hg/patches/patch-lib_certhigh_ocsp.c
	nss-hg/patches/patch-lib_dbm_src_mktemp.c
	nss-hg/patches/patch-lib_freebl_mpi_mpi.c
	nss-hg/patches/patch-lib_nss_nssinit.c
	nss-hg/patches/patch-lib_softoken_legacydb_lowcert.c
	nss-hg/patches/patch-lib_util_oidstring.c
	nss-hg/patches/patch-lib_util_portreg.c
	nss-hg/patches/patch-lib_util_utilpars.c
	nss-hg/patches/patch-lib_zlib_gzread.c
	nss-hg/patches/patch-lib_zlib_gzwrite.c

Log Message:
nss-hg: fix some ctype(3) issues and add missing includes in two files.

More ctype(3) fixes are needed, I've contacted upstream.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=1b1dadb280f609f1e4bc99d64c676c1863d359f8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 nss-hg/distinfo                                    |   14 +
 nss-hg/patches/patch-cmd_fipstest_fipstest.c       | 1075 ++++++++++++++++++++
 nss-hg/patches/patch-cmd_lib_basicutil.c           |   15 +
 nss-hg/patches/patch-lib_certdb_alg1485.c          |   24 +
 nss-hg/patches/patch-lib_certdb_certdb.c           |   24 +
 nss-hg/patches/patch-lib_certhigh_ocsp.c           |   15 +
 nss-hg/patches/patch-lib_dbm_src_mktemp.c          |   15 +
 nss-hg/patches/patch-lib_freebl_mpi_mpi.c          |   24 +
 nss-hg/patches/patch-lib_nss_nssinit.c             |   36 +
 .../patches/patch-lib_softoken_legacydb_lowcert.c  |   24 +
 nss-hg/patches/patch-lib_util_oidstring.c          |   15 +
 nss-hg/patches/patch-lib_util_portreg.c            |   24 +
 nss-hg/patches/patch-lib_util_utilpars.c           |   15 +
 nss-hg/patches/patch-lib_zlib_gzread.c             |   14 +
 nss-hg/patches/patch-lib_zlib_gzwrite.c            |   14 +
 15 files changed, 1348 insertions(+)

diffs:
diff --git a/nss-hg/distinfo b/nss-hg/distinfo
index b591078..fd443a3 100644
--- a/nss-hg/distinfo
+++ b/nss-hg/distinfo
@@ -3,6 +3,8 @@ $NetBSD: distinfo,v 1.5 2015/03/17 14:28:41 thomasklausner Exp $
 SHA1 (nss-3.16.5.tar.gz) = bec488835954698e7b19149a15205db299cd13de
 RMD160 (nss-3.16.5.tar.gz) = 19630a0815d69ee5959b562d7849d35d677c6329
 Size (nss-3.16.5.tar.gz) = 6429830 bytes
+SHA1 (patch-cmd_fipstest_fipstest.c) = 870488f07e8c061d58c129bad3bb4982d1f08fb4
+SHA1 (patch-cmd_lib_basicutil.c) = 2fb6b8e5212cce352147e7241941d510e8137401
 SHA1 (patch-cmd_shlibsign_sign.sh) = 9be9719d9e4cc212d9503616a1145b8c68b97a6a
 SHA1 (patch-coreconf_DragonFly.mk) = 328c0f3d4f03ab6d0efcfec3461d97da1c3e387a
 SHA1 (patch-coreconf_OpenBSD.mk) = ca38900a3af42a28848b64abe382a3b596849d0b
@@ -10,10 +12,22 @@ SHA1 (patch-coreconf_SunOS5.mk) = db81e955db52ccccc2dbdae364449870b9724e15
 SHA1 (patch-coreconf_arch.mk) = 5462c0620564a2ad4a0deb9d71c427e8c0d426eb
 SHA1 (patch-coreconf_config.mk) = 0fdcd3fea51ea2c250ab88197b79ae2b91f27ef5
 SHA1 (patch-lib_Makefile) = cd6f58c0ed02a93b7e6ef75c2763ee3633e453eb
+SHA1 (patch-lib_certdb_alg1485.c) = 01fc731901ff59e24723091345f09f3eb2c85956
+SHA1 (patch-lib_certdb_certdb.c) = 8636b6b53befe44e3c11a93980eecb2a440815b1
+SHA1 (patch-lib_certhigh_ocsp.c) = 7ac69dfec32d7102757133c28354dc33f762104e
+SHA1 (patch-lib_dbm_src_mktemp.c) = 52fefaf4d085d9a115a65d3a22ec5cca4c090cbc
 SHA1 (patch-lib_freebl_Makefile) = aedfd6f12872bc94256e1c6be4628334f363c2bb
 SHA1 (patch-lib_freebl_blapi.h) = 00e0dcfe1f6a54bffa97c4852f9f9fcb5ab783e1
 SHA1 (patch-lib_freebl_config.mk) = ade7f656b900f93f1fdaa036a733529af132d2ca
+SHA1 (patch-lib_freebl_mpi_mpi.c) = 2d358f72da7a1fe9f257716119e5ead5ed7006ed
 SHA1 (patch-lib_freebl_sha-fast-amd64-sun.s) = 6feb56632584f04c5259dcb72e330e13d485b50a
+SHA1 (patch-lib_nss_nssinit.c) = 5caa798e9debc6991db5bde481673807e97d796d
 SHA1 (patch-lib_softoken_config.mk) = c1262775ba60facae1b00324b668dfab0eecc6c3
+SHA1 (patch-lib_softoken_legacydb_lowcert.c) = bd04607b61d9a62d43df074beb2fc9481db6e015
+SHA1 (patch-lib_util_oidstring.c) = 5017383c8f16b663792d6910b8d845b16e466ed3
+SHA1 (patch-lib_util_portreg.c) = 800b008605f60f6b909be7e973bad70c047ed91b
+SHA1 (patch-lib_util_utilpars.c) = d5fe5c344fc10c7fe1e8708a64ed082c2f536058
+SHA1 (patch-lib_zlib_gzread.c) = ee8c4cf094ccd1938a55350ad0529e0be31e0dd4
+SHA1 (patch-lib_zlib_gzwrite.c) = e094e35e7f73ddd1d24fc11de7765407e3ecff57
 SHA1 (patch-tests_libpkix_libpkix.sh) = 4df0e877ab59637fcc4b54c29b14408c73ff5105
 SHA1 (patch-tests_multinit_multinit.sh) = 97f6895c693a2606f9d178c10886bd20cc9187ed
diff --git a/nss-hg/patches/patch-cmd_fipstest_fipstest.c b/nss-hg/patches/patch-cmd_fipstest_fipstest.c
new file mode 100644
index 0000000..a314d47
--- /dev/null
+++ b/nss-hg/patches/patch-cmd_fipstest_fipstest.c
@@ -0,0 +1,1075 @@
+$NetBSD$
+
+Missing ctype(3) casts.
+
+--- cmd/fipstest/fipstest.c.orig	2016-01-30 10:42:11.000000000 +0000
++++ cmd/fipstest/fipstest.c
+@@ -127,7 +127,7 @@ from_hex_str(unsigned char *buf, unsigne
+ 
+     /* count the hex digits */
+     nxdigit = 0;
+-    for (nxdigit = 0; isxdigit(str[nxdigit]); nxdigit++) {
++    for (nxdigit = 0; isxdigit((unsigned char)str[nxdigit]); nxdigit++) {
+         /* empty body */
+     }
+     if (nxdigit == 0) {
+@@ -335,7 +335,7 @@ tdea_kat_mmt(char *reqfn)
+         /* NumKeys */
+         if (strncmp(&buf[0], "NumKeys", 7) == 0) {
+             i = 7;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             numKeys = buf[i];
+@@ -359,10 +359,10 @@ tdea_kat_mmt(char *reqfn)
+         if (numKeys == 0) {
+             if (strncmp(buf, "KEYs", 4) == 0) {
+                 i = 4;
+-                while (isspace(buf[i]) || buf[i] == '=') {
++                while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                     i++;
+                 }
+-                for (j=0; isxdigit(buf[i]); i+=2,j++) {
++                for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                     hex_to_byteval(&buf[i], &key[j]);
+                     key[j+8] = key[j];
+                     key[j+16] = key[j];
+@@ -374,10 +374,10 @@ tdea_kat_mmt(char *reqfn)
+             /* KEY1 = ... */
+             if (strncmp(buf, "KEY1", 4) == 0) {
+                 i = 4;
+-                while (isspace(buf[i]) || buf[i] == '=') {
++                while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                     i++;
+                 }
+-                for (j=0; isxdigit(buf[i]); i+=2,j++) {
++                for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                     hex_to_byteval(&buf[i], &key[j]);
+                 }
+                 fputs(buf, resp);
+@@ -386,10 +386,10 @@ tdea_kat_mmt(char *reqfn)
+             /* KEY2 = ... */
+             if (strncmp(buf, "KEY2", 4) == 0) {
+                 i = 4;
+-                while (isspace(buf[i]) || buf[i] == '=') {
++                while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                     i++;
+                 }
+-                for (j=8; isxdigit(buf[i]); i+=2,j++) {
++                for (j=8; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                     hex_to_byteval(&buf[i], &key[j]);
+                 }
+                 fputs(buf, resp);
+@@ -398,10 +398,10 @@ tdea_kat_mmt(char *reqfn)
+             /* KEY3 = ... */
+             if (strncmp(buf, "KEY3", 4) == 0) {
+                 i = 4;
+-                while (isspace(buf[i]) || buf[i] == '=') {
++                while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                     i++;
+                 }
+-                for (j=16; isxdigit(buf[i]); i+=2,j++) {
++                for (j=16; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                     hex_to_byteval(&buf[i], &key[j]);
+                 }
+                 fputs(buf, resp);
+@@ -413,7 +413,7 @@ tdea_kat_mmt(char *reqfn)
+         if (strncmp(buf, "IV", 2) == 0) {
+             mode = NSS_DES_EDE3_CBC;
+             i = 2;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<sizeof iv; i+=2,j++) {
+@@ -430,10 +430,10 @@ tdea_kat_mmt(char *reqfn)
+                 goto loser;
+             }
+             i = 9;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &plaintext[j]);
+             }
+             plaintextlen = j;
+@@ -460,10 +460,10 @@ tdea_kat_mmt(char *reqfn)
+             }
+  
+             i = 10;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &ciphertext[j]);
+             }
+             ciphertextlen = j;
+@@ -770,7 +770,7 @@ tdea_mct(int mode, char *reqfn)
+         /* NumKeys */
+         if (strncmp(&buf[0], "NumKeys", 7) == 0) {
+             i = 7;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             numKeys = atoi(&buf[i]);
+@@ -779,10 +779,10 @@ tdea_mct(int mode, char *reqfn)
+         /* KEY1 = ... */
+         if (strncmp(buf, "KEY1", 4) == 0) {
+             i = 4;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &key[j]);
+             }
+             continue;
+@@ -790,10 +790,10 @@ tdea_mct(int mode, char *reqfn)
+         /* KEY2 = ... */
+         if (strncmp(buf, "KEY2", 4) == 0) {
+             i = 4;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=8; isxdigit(buf[i]); i+=2,j++) {
++            for (j=8; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &key[j]);
+             }
+             continue;
+@@ -801,10 +801,10 @@ tdea_mct(int mode, char *reqfn)
+         /* KEY3 = ... */
+         if (strncmp(buf, "KEY3", 4) == 0) {
+             i = 4;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=16; isxdigit(buf[i]); i+=2,j++) {
++            for (j=16; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &key[j]);
+             }
+             continue;
+@@ -813,7 +813,7 @@ tdea_mct(int mode, char *reqfn)
+         /* IV = ... */
+         if (strncmp(buf, "IV", 2) == 0) {
+             i = 2;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<sizeof iv; i+=2,j++) {
+@@ -831,7 +831,7 @@ tdea_mct(int mode, char *reqfn)
+             }
+             /* PT[0] = PT */
+             i = 9;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<sizeof plaintext; i+=2,j++) {
+@@ -854,10 +854,10 @@ tdea_mct(int mode, char *reqfn)
+             }
+             /* CT[0] = CT */
+             i = 10;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &ciphertext[j]);
+             }
+             
+@@ -1063,10 +1063,10 @@ aes_gcm(char *reqfn, int encrypt)
+         /* KEY = ... */
+         if (strncmp(buf, "Key", 3) == 0) {
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &key[j]);
+             }
+             keysize = j;
+@@ -1076,7 +1076,7 @@ aes_gcm(char *reqfn, int encrypt)
+         /* IV = ... */
+         if (strncmp(buf, "IV", 2) == 0) {
+             i = 2;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<sizeof iv; i+=2,j++) {
+@@ -1093,10 +1093,10 @@ aes_gcm(char *reqfn, int encrypt)
+             }
+ 
+             i = 2;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &plaintext[j]);
+             }
+             plaintextlen = j;
+@@ -1111,10 +1111,10 @@ aes_gcm(char *reqfn, int encrypt)
+             }
+ 
+             i = 2;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &ciphertext[j]);
+             }
+             ciphertextlen = j;
+@@ -1123,10 +1123,10 @@ aes_gcm(char *reqfn, int encrypt)
+         }
+         if (strncmp(buf, "AAD", 3) == 0) {
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &aad[j]);
+             }
+             aadlen = j;
+@@ -1175,10 +1175,10 @@ aes_gcm(char *reqfn, int encrypt)
+             }
+ 
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &ciphertext[j+ciphertextlen]);
+             }
+             ciphertextlen += j;
+@@ -1274,10 +1274,10 @@ aes_kat_mmt(char *reqfn)
+         /* KEY = ... */
+         if (strncmp(buf, "KEY", 3) == 0) {
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &key[j]);
+             }
+             keysize = j;
+@@ -1288,7 +1288,7 @@ aes_kat_mmt(char *reqfn)
+         if (strncmp(buf, "IV", 2) == 0) {
+             mode = NSS_AES_CBC;
+             i = 2;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<sizeof iv; i+=2,j++) {
+@@ -1305,10 +1305,10 @@ aes_kat_mmt(char *reqfn)
+             }
+ 
+             i = 9;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &plaintext[j]);
+             }
+             plaintextlen = j;
+@@ -1336,10 +1336,10 @@ aes_kat_mmt(char *reqfn)
+             }
+ 
+             i = 10;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &ciphertext[j]);
+             }
+             ciphertextlen = j;
+@@ -1472,10 +1472,10 @@ aes_ecb_mct(char *reqfn)
+         if (strncmp(buf, "KEY", 3) == 0) {
+             /* Key[0] = Key */
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &key[j]);
+             }
+             keysize = j;
+@@ -1489,7 +1489,7 @@ aes_ecb_mct(char *reqfn)
+             }
+             /* PT[0] = PT */
+             i = 9;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<sizeof plaintext; i+=2,j++) {
+@@ -1587,10 +1587,10 @@ aes_ecb_mct(char *reqfn)
+             }
+             /* CT[0] = CT */
+             i = 10;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &ciphertext[j]);
+             }
+ 
+@@ -1757,10 +1757,10 @@ aes_cbc_mct(char *reqfn)
+         if (strncmp(buf, "KEY", 3) == 0) {
+             /* Key[0] = Key */
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &key[j]);
+             }
+             keysize = j;
+@@ -1770,7 +1770,7 @@ aes_cbc_mct(char *reqfn)
+         if (strncmp(buf, "IV", 2) == 0) {
+             /* IV[0] = IV */
+             i = 2;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<sizeof iv; i+=2,j++) {
+@@ -1786,7 +1786,7 @@ aes_cbc_mct(char *reqfn)
+             }
+             /* PT[0] = PT */
+             i = 9;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<sizeof plaintext; i+=2,j++) {
+@@ -1898,10 +1898,10 @@ aes_cbc_mct(char *reqfn)
+             }
+             /* CT[0] = CT */
+             i = 10;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &ciphertext[j]);
+             }
+ 
+@@ -2373,7 +2373,7 @@ ecdsa_keypair_test(char *reqfn)
+ 
+             src = &buf[1];
+             dst = &curve[4];
+-            *dst++ = tolower(*src);
++            *dst++ = tolower((unsigned char)*src);
+             src += 2;  /* skip the hyphen */
+             *dst++ = *src++;
+             *dst++ = *src++;
+@@ -2484,7 +2484,7 @@ ecdsa_pkv_test(char *reqfn)
+ 
+             src = &buf[1];
+             dst = &curve[4];
+-            *dst++ = tolower(*src);
++            *dst++ = tolower((unsigned char)*src);
+             src += 2;  /* skip the hyphen */
+             *dst++ = *src++;
+             *dst++ = *src++;
+@@ -2521,7 +2521,7 @@ ecdsa_pkv_test(char *reqfn)
+         if (strncmp(buf, "Qx", 2) == 0) {
+             fputs(buf, ecdsaresp);
+             i = 2;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             keyvalid = from_hex_str(&pubkey.data[1], len, &buf[i]);
+@@ -2535,7 +2535,7 @@ ecdsa_pkv_test(char *reqfn)
+                 continue;
+             }
+             i = 2;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             keyvalid = from_hex_str(&pubkey.data[1+len], len, &buf[i]);
+@@ -2609,7 +2609,7 @@ ecdsa_siggen_test(char *reqfn)
+ 
+             src = &buf[1];
+             dst = &curve[4];
+-            *dst++ = tolower(*src);
++            *dst++ = tolower((unsigned char)*src);
+             src += 2;  /* skip the hyphen */
+             *dst++ = *src++;
+             *dst++ = *src++;
+@@ -2653,10 +2653,10 @@ ecdsa_siggen_test(char *reqfn)
+             ECPrivateKey *ecpriv;
+ 
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &msg[j]);
+             }
+             msglen = j;
+@@ -2779,7 +2779,7 @@ ecdsa_sigver_test(char *reqfn)
+ 
+             src = &buf[1];
+             dst = &curve[4];
+-            *dst++ = tolower(*src);
++            *dst++ = tolower((unsigned char)*src);
+             src += 2;  /* skip the hyphen */
+             *dst++ = *src++;
+             *dst++ = *src++;
+@@ -2843,10 +2843,10 @@ ecdsa_sigver_test(char *reqfn)
+         /* Msg = ... */
+         if (strncmp(buf, "Msg", 3) == 0) {
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &msg[j]);
+             }
+             msglen = j;
+@@ -2871,7 +2871,7 @@ ecdsa_sigver_test(char *reqfn)
+         if (strncmp(buf, "Qx", 2) == 0) {
+             fputs(buf, ecdsaresp);
+             i = 2;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             keyvalid = from_hex_str(&ecpub.publicValue.data[1], flen,
+@@ -2885,7 +2885,7 @@ ecdsa_sigver_test(char *reqfn)
+                 continue;
+             }
+             i = 2;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             keyvalid = from_hex_str(&ecpub.publicValue.data[1+flen], flen,
+@@ -2907,7 +2907,7 @@ ecdsa_sigver_test(char *reqfn)
+         if (buf[0] == 'R') {
+             fputs(buf, ecdsaresp);
+             i = 1;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             sigvalid = from_hex_str(sig, olen, &buf[i]);
+@@ -2917,7 +2917,7 @@ ecdsa_sigver_test(char *reqfn)
+         if (buf[0] == 'S') {
+             fputs(buf, ecdsaresp);
+             i = 1;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             if (sigvalid) {
+@@ -2949,7 +2949,7 @@ loser:
+ PRBool
+ isblankline(char *b)
+ {
+-   while (isspace(*b)) b++;
++   while (isspace((unsigned char)*b)) b++;
+    if ((*b == '\n') || (*b == 0)) {
+         return PR_TRUE;
+    }
+@@ -3104,7 +3104,7 @@ drbg(char *reqfn)
+         if (strncmp(buf, "[PredictionResistance", 21)  == 0) {
+ #ifdef HANDLE_PREDICTION_RESISTANCE
+             i = 21;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }    
+             if (strncmp(buf, "False", 5) == 0) {
+@@ -3237,11 +3237,11 @@ drbg(char *reqfn)
+             if (entropyInput) {
+                 memset(entropyInput, 0, entropyInputLen);
+                 i = 18;
+-                while (isspace(buf[i]) || buf[i] == '=') {
++                while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                     i++;
+                 }            
+                 
+-                for (j=0; isxdigit(buf[i]); i+=2,j++) { /*j<entropyInputLen*/
++                for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) { /*j<entropyInputLen*/
+                     hex_to_byteval(&buf[i], &entropyInput[j]);
+                 }           
+             }
+@@ -3254,10 +3254,10 @@ drbg(char *reqfn)
+             if (additionalInput) {
+                 memset(additionalInput, 0, additionalInputLen);
+                 i = 21;
+-                while (isspace(buf[i]) || buf[i] == '=') {
++                while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                     i++;
+                 }
+-                for (j=0; isxdigit(buf[i]); i+=2,j++) { /*j<additionalInputLen*/
++                for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) { /*j<additionalInputLen*/
+                     hex_to_byteval(&buf[i], &additionalInput[j]);
+                 }    
+             }
+@@ -3269,10 +3269,10 @@ drbg(char *reqfn)
+         /* Entropy input = ... */
+         if (strncmp(buf, "EntropyInput", 12) == 0) {
+             i = 12;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) { /*j<entropyInputLen*/
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) { /*j<entropyInputLen*/
+                 hex_to_byteval(&buf[i], &entropyInput[j]);
+             }  
+             fputs(buf, rngresp);
+@@ -3282,10 +3282,10 @@ drbg(char *reqfn)
+         /* nouce = ... */
+         if (strncmp(buf, "Nonce", 5) == 0) {
+             i = 5;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) { /*j<nonceLen*/
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) { /*j<nonceLen*/
+                 hex_to_byteval(&buf[i], &nonce[j]);
+             }  
+             fputs(buf, rngresp);
+@@ -3296,10 +3296,10 @@ drbg(char *reqfn)
+         if (strncmp(buf, "PersonalizationString", 21) == 0) {
+             if (personalizationString) {
+                 i = 21;
+-                while (isspace(buf[i]) || buf[i] == '=') {
++                while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                     i++;
+                 }
+-                for (j=0; isxdigit(buf[i]); i+=2,j++) { /*j<personalizationStringLen*/
++                for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) { /*j<personalizationStringLen*/
+                     hex_to_byteval(&buf[i], &personalizationString[j]);
+                 }
+             }
+@@ -3312,10 +3312,10 @@ drbg(char *reqfn)
+         if (strncmp(buf, "AdditionalInput", 15) == 0) {
+             if (additionalInput) {
+                 i = 15;
+-                while (isspace(buf[i]) || buf[i] == '=') {
++                while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                     i++;
+                 }
+-                for (j=0; isxdigit(buf[i]); i+=2,j++) { /*j<additionalInputLen*/
++                for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) { /*j<additionalInputLen*/
+                     hex_to_byteval(&buf[i], &additionalInput[j]);
+                 } 
+             }
+@@ -3332,10 +3332,10 @@ drbg(char *reqfn)
+         /* Returned bits = ... */
+         if (strncmp(buf, "ReturnedBits", 12) == 0) {
+             i = 12;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) { /*j<additionalInputLen*/
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) { /*j<additionalInputLen*/
+                 hex_to_byteval(&buf[i], &predictedreturn_bytes[j]);
+             }          
+ 
+@@ -3416,7 +3416,7 @@ rng_vst(char *reqfn)
+         /* Q = ... */
+         if (buf[0] == 'Q') {
+             i = 1;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<sizeof Q; i+=2,j++) {
+@@ -3438,7 +3438,7 @@ rng_vst(char *reqfn)
+         /* b = ... */
+         if (buf[0] == 'b') {
+             i = 1;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             b = atoi(&buf[i]);
+@@ -3451,7 +3451,7 @@ rng_vst(char *reqfn)
+         /* XKey = ... */
+         if (strncmp(buf, "XKey", 4) == 0) {
+             i = 4;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<b/8; i+=2,j++) {
+@@ -3463,7 +3463,7 @@ rng_vst(char *reqfn)
+         /* XSeed = ... */
+         if (strncmp(buf, "XSeed", 5) == 0) {
+             i = 5;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<b/8; i+=2,j++) {
+@@ -3539,7 +3539,7 @@ rng_mct(char *reqfn)
+ 	/* Q = ... */
+ 	if (buf[0] == 'Q') {
+ 	    i = 1;
+-	    while (isspace(buf[i]) || buf[i] == '=') {
++	    while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+ 		i++;
+ 	    }
+ 	    for (j=0; j<sizeof Q; i+=2,j++) {
+@@ -3561,7 +3561,7 @@ rng_mct(char *reqfn)
+ 	/* b = ... */
+ 	if (buf[0] == 'b') {
+ 	    i = 1;
+-	    while (isspace(buf[i]) || buf[i] == '=') {
++	    while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+ 		i++;
+ 	    }
+ 	    b = atoi(&buf[i]);
+@@ -3574,7 +3574,7 @@ rng_mct(char *reqfn)
+ 	/* XKey = ... */
+ 	if (strncmp(buf, "XKey", 4) == 0) {
+ 	    i = 4;
+-	    while (isspace(buf[i]) || buf[i] == '=') {
++	    while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+ 		i++;
+ 	    }
+ 	    for (j=0; j<b/8; i+=2,j++) {
+@@ -3587,7 +3587,7 @@ rng_mct(char *reqfn)
+ 	if (strncmp(buf, "XSeed", 5) == 0) {
+ 	    unsigned int k;
+ 	    i = 5;
+-	    while (isspace(buf[i]) || buf[i] == '=') {
++	    while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+ 		i++;
+ 	    }
+ 	    for (j=0; j<b/8; i+=2,j++) {
+@@ -3736,7 +3736,7 @@ void sha_test(char *reqfn) 
+         if (buf[0] == '[') {
+             if (strncmp(&buf[1], "L ", 1) == 0) {
+                 i = 2;
+-                while (isspace(buf[i]) || buf[i] == '=') {
++                while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                     i++;
+                 }
+                 MDlen = atoi(&buf[i]);
+@@ -3747,7 +3747,7 @@ void sha_test(char *reqfn) 
+         /* Len = Length of the Input Message Length  ... */
+         if (strncmp(buf, "Len", 3) == 0) {
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             if (msg) {
+@@ -3771,7 +3771,7 @@ void sha_test(char *reqfn) 
+         /* MSG = ... */
+         if (strncmp(buf, "Msg", 3) == 0) {
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j< msgLen; i+=2,j++) {
+@@ -3795,7 +3795,7 @@ void sha_test(char *reqfn) 
+         /* Seed = ... */
+         if (strncmp(buf, "Seed", 4) == 0) {
+             i = 4;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<sizeof seed; i+=2,j++) {
+@@ -3913,11 +3913,11 @@ void hmac_test(char *reqfn) 
+     while (fgets(buf, bufSize, req) != NULL) {
+         if (strncmp(buf, "Mac", 3) == 0) {
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             memset(expectedHMAC, 0, HASH_LENGTH_MAX);
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) { 
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) { 
+                 hex_to_byteval(&buf[i], &expectedHMAC[j]);
+             }
+             if (memcmp(HMAC, expectedHMAC, TLen) != 0) {
+@@ -3943,7 +3943,7 @@ void hmac_test(char *reqfn) 
+         if (buf[0] == '[') {
+             if (strncmp(&buf[1], "L ", 1) == 0) {
+                 i = 2;
+-                while (isspace(buf[i]) || buf[i] == '=') {
++                while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                     i++;
+                 }
+                 /* HMACLen will get reused for Tlen */
+@@ -3971,7 +3971,7 @@ void hmac_test(char *reqfn) 
+         /* KLen = Length of the Input Secret Key ... */
+         if (strncmp(buf, "Klen", 4) == 0) {
+             i = 4;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             keyLen = atoi(&buf[i]); /* in bytes */
+@@ -3981,7 +3981,7 @@ void hmac_test(char *reqfn) 
+         /* key = the secret key for the key to MAC */
+         if (strncmp(buf, "Key", 3) == 0) {
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j< keyLen; i+=2,j++) {
+@@ -3992,7 +3992,7 @@ void hmac_test(char *reqfn) 
+         /* TLen = Length of the calculated HMAC */
+         if (strncmp(buf, "Tlen", 4) == 0) {
+             i = 4;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             TLen = atoi(&buf[i]); /* in bytes */
+@@ -4002,7 +4002,7 @@ void hmac_test(char *reqfn) 
+         /* MSG = to HMAC always 128 bytes for these tests */
+         if (strncmp(buf, "Msg", 3) == 0) {
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j< msgLen; i+=2,j++) {
+@@ -4283,7 +4283,7 @@ dsa_pqgver_test(char *reqfn)
+         /* P = ... */
+         if (buf[0] == 'P') {
+             i = 1;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j< pqg.prime.len; i+=2,j++) {
+@@ -4297,7 +4297,7 @@ dsa_pqgver_test(char *reqfn)
+         /* Q = ... */
+         if (buf[0] == 'Q') {
+             i = 1;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j< pqg.subPrime.len; i+=2,j++) {
+@@ -4315,7 +4315,7 @@ dsa_pqgver_test(char *reqfn)
+                 SECITEM_ZfreeItem(&pqg.base, PR_FALSE);
+             }
+             SECITEM_AllocItem(NULL, &pqg.base, pghSize);
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j< pqg.base.len; i+=2,j++) {
+@@ -4337,10 +4337,10 @@ dsa_pqgver_test(char *reqfn)
+             i = 0;
+         }
+         if (i) {
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &vfy.seed.data[j]);
+             }
+             vfy.seed.len = j;
+@@ -4366,10 +4366,10 @@ dsa_pqgver_test(char *reqfn)
+             (strncmp(buf,"qseed",5) == 0))
+         {
+             i = 5;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=vfy.seed.len; isxdigit(buf[i]); i+=2,j++) {
++            for (j=vfy.seed.len; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &vfy.seed.data[j]);
+             }
+             vfy.seed.len = j;
+@@ -4379,7 +4379,7 @@ dsa_pqgver_test(char *reqfn)
+         }
+         if (strncmp(buf, "index", 4) == 0) {
+             i=5;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             hex_to_byteval(&buf[i], &vfy.h.data[0]);
+@@ -4446,10 +4446,10 @@ dsa_pqgver_test(char *reqfn)
+             SECStatus rv, result = SECFailure;
+ 
+             i = 1;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &vfy.h.data[j]);
+             }
+             vfy.h.len = j;
+@@ -4801,10 +4801,10 @@ dsa_siggen_test(char *reqfn)
+             memset(sig,  0, sizeof sig);
+ 
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &msg[j]);
+             }
+             if (fips_hashBuf(hashType, hashBuf, msg, j) != SECSuccess) {
+@@ -4948,7 +4948,7 @@ dsa_sigver_test(char *reqfn)
+         /* P = ... */
+         if (buf[0] == 'P') {
+             i = 1;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             memset(pubkey.params.prime.data, 0, pubkey.params.prime.len);
+@@ -4963,7 +4963,7 @@ dsa_sigver_test(char *reqfn)
+         /* Q = ... */
+         if (buf[0] == 'Q') {
+             i = 1;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             memset(pubkey.params.subPrime.data, 0, pubkey.params.subPrime.len);
+@@ -4978,7 +4978,7 @@ dsa_sigver_test(char *reqfn)
+         /* G = ... */
+         if (buf[0] == 'G') {
+             i = 1;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             memset(pubkey.params.base.data, 0, pubkey.params.base.len);
+@@ -5001,10 +5001,10 @@ dsa_sigver_test(char *reqfn)
+             }
+ 
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &msg[j]);
+             }
+             if (fips_hashBuf(hashType, hashBuf, msg, j) != SECSuccess) {
+@@ -5020,7 +5020,7 @@ dsa_sigver_test(char *reqfn)
+         /* Y = ... */
+         if (buf[0] == 'Y') {
+             i = 1;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             memset(pubkey.publicValue.data, 0, pubkey.params.subPrime.len);
+@@ -5036,7 +5036,7 @@ dsa_sigver_test(char *reqfn)
+         if (buf[0] == 'R') {
+             memset(sig,  0, sizeof sig);
+             i = 1;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j< pubkey.params.subPrime.len; i+=2,j++) {
+@@ -5055,7 +5055,7 @@ dsa_sigver_test(char *reqfn)
+             }
+ 
+             i = 1;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=pubkey.params.subPrime.len; 
+@@ -5312,7 +5312,7 @@ rsa_siggen_test(char *reqfn)
+         /* SHAAlg = ... */
+         if (strncmp(buf, "SHAAlg", 6) == 0) {
+            i = 6;
+-           while (isspace(buf[i]) || buf[i] == '=') {
++           while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                i++;
+            }
+            /* set the SHA Algorithm */
+@@ -5360,10 +5360,10 @@ rsa_siggen_test(char *reqfn)
+             memset(rsa_computed_signature, 0, sizeof rsa_computed_signature);
+ 
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+-            for (j=0; isxdigit(buf[i]) && j < sizeof(msg); i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]) && j < sizeof(msg); i+=2,j++) {
+                 hex_to_byteval(&buf[i], &msg[j]);
+             }
+             shaLength = fips_hashLen(shaAlg);
+@@ -5491,7 +5491,7 @@ rsa_sigver_test(char *reqfn)
+         /* n = ... modulus */
+         if (buf[0] == 'n') {
+             i = 1;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             keyvalid = from_hex_str(&rsaBlapiPublicKey.modulus.data[0],
+@@ -5509,7 +5509,7 @@ rsa_sigver_test(char *reqfn)
+         /* SHAAlg = ... */
+         if (strncmp(buf, "SHAAlg", 6) == 0) {
+            i = 6;
+-           while (isspace(buf[i]) || buf[i] == '=') {
++           while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                i++;
+            }
+            /* set the SHA Algorithm */
+@@ -5543,11 +5543,11 @@ rsa_sigver_test(char *reqfn)
+             }
+ 
+             i = 1;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             /* skip leading zero's */
+-            while (isxdigit(buf[i])) {
++            while (isxdigit((unsigned char)buf[i])) {
+                 hex_to_byteval(&buf[i], &t);
+                 if (t == 0) {
+                     i+=2;
+@@ -5555,7 +5555,7 @@ rsa_sigver_test(char *reqfn)
+             }
+         
+             /* get the exponent */
+-            for (j=0; isxdigit(buf[i]) && j < sizeof data; i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]) && j < sizeof data; i+=2,j++) {
+                 hex_to_byteval(&buf[i], &data[j]);
+             }
+ 
+@@ -5582,11 +5582,11 @@ rsa_sigver_test(char *reqfn)
+             memset(msg, 0, sizeof msg);
+ 
+             i = 3;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+ 
+-            for (j=0; isxdigit(buf[i]) && j < sizeof msg; i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]) && j < sizeof msg; i+=2,j++) {
+                 hex_to_byteval(&buf[i], &msg[j]);
+             }
+ 
+@@ -5618,11 +5618,11 @@ rsa_sigver_test(char *reqfn)
+ 
+             memset(signature, 0, sizeof(signature));
+             i = 1;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+ 
+-            for (j=0; isxdigit(buf[i]) && j < sizeof signature; i+=2,j++) {
++            for (j=0; isxdigit((unsigned char)buf[i]) && j < sizeof signature; i+=2,j++) {
+                 hex_to_byteval(&buf[i], &signature[j]);
+             }
+ 
+@@ -5824,7 +5824,7 @@ tls(char *reqfn)
+         /* pre_master_secret = ... */
+         if (strncmp(buf, "pre_master_secret", 17) == 0) {
+             i = 17;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<pms_len; i+=2,j++) {
+@@ -5836,7 +5836,7 @@ tls(char *reqfn)
+         /* serverHello_random = ... */
+         if (strncmp(buf, "serverHello_random", 18) == 0) {
+             i = 18;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<SSL3_RANDOM_LENGTH; i+=2,j++) {
+@@ -5848,7 +5848,7 @@ tls(char *reqfn)
+         /* clientHello_random = ... */
+         if (strncmp(buf, "clientHello_random", 18) == 0) {
+             i = 18;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<SSL3_RANDOM_LENGTH; i+=2,j++) {
+@@ -5860,7 +5860,7 @@ tls(char *reqfn)
+         /* server_random = ... */
+         if (strncmp(buf, "server_random", 13) == 0) {
+             i = 13;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<SSL3_RANDOM_LENGTH; i+=2,j++) {
+@@ -5876,7 +5876,7 @@ tls(char *reqfn)
+  	    CK_OBJECT_HANDLE master_handle;
+  	    CK_OBJECT_HANDLE fake_handle;
+             i = 13;
+-            while (isspace(buf[i]) || buf[i] == '=') {
++            while (isspace((unsigned char)buf[i]) || buf[i] == '=') {
+                 i++;
+             }
+             for (j=0; j<SSL3_RANDOM_LENGTH; i+=2,j++) {
diff --git a/nss-hg/patches/patch-cmd_lib_basicutil.c b/nss-hg/patches/patch-cmd_lib_basicutil.c
new file mode 100644
index 0000000..a7b0c8f
--- /dev/null
+++ b/nss-hg/patches/patch-cmd_lib_basicutil.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Missing ctype(3) casts.
+
+--- cmd/lib/basicutil.c.orig	2016-01-30 10:42:11.000000000 +0000
++++ cmd/lib/basicutil.c
+@@ -676,7 +676,7 @@ SECU_SECItemToHex(const SECItem * item, 
+ }
+ 
+ static unsigned char nibble(char c) {
+-    c = PORT_Tolower(c);
++    c = PORT_Tolower((unsigned char)c);
+     return ( c >= '0' && c <= '9') ? c - '0' :
+            ( c >= 'a' && c <= 'f') ? c - 'a' +10 : -1;
+ }
diff --git a/nss-hg/patches/patch-lib_certdb_alg1485.c b/nss-hg/patches/patch-lib_certdb_alg1485.c
new file mode 100644
index 0000000..bad73e8
--- /dev/null
+++ b/nss-hg/patches/patch-lib_certdb_alg1485.c
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Missing ctype(3) casts.
+
+--- lib/certdb/alg1485.c.orig	2016-01-30 10:42:11.000000000 +0000
++++ lib/certdb/alg1485.c
+@@ -1343,7 +1343,7 @@ CERT_GetCertificateEmailAddress(CERTCert
+     }
+     if (rawEmailAddr) {
+         for (i = 0; i <= (int)PORT_Strlen(rawEmailAddr); i++) {
+-            rawEmailAddr[i] = tolower(rawEmailAddr[i]);
++            rawEmailAddr[i] = tolower((unsigned char)rawEmailAddr[i]);
+         }
+     }
+ 
+@@ -1369,7 +1369,7 @@ appendStringToBuf(char* dest, char* src,
+     if (dest && src && src[0] && *pRemaining > (len = PL_strlen(src))) {
+         PRUint32 i;
+         for (i = 0; i < len; ++i)
+-            dest[i] = tolower(src[i]);
++            dest[i] = tolower((unsigned char)src[i]);
+         dest[len] = 0;
+         dest += len + 1;
+         *pRemaining -= len + 1;
diff --git a/nss-hg/patches/patch-lib_certdb_certdb.c b/nss-hg/patches/patch-lib_certdb_certdb.c
new file mode 100644
index 0000000..e654bf5
--- /dev/null
+++ b/nss-hg/patches/patch-lib_certdb_certdb.c
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Missing ctype(3) casts.
+
+--- lib/certdb/certdb.c.orig	2016-01-30 10:42:11.000000000 +0000
++++ lib/certdb/certdb.c
+@@ -1288,7 +1288,7 @@ sec_lower_string(char *s)
+     }
+ 
+     while (*s) {
+-        *s = PORT_Tolower(*s);
++        *s = PORT_Tolower((unsigned char)*s);
+         s++;
+     }
+ 
+@@ -2301,7 +2301,7 @@ CERT_FixupEmailAddr(const char *emailAdd
+ 
+     /* make it lower case */
+     while (*str) {
+-        *str = tolower(*str);
++        *str = tolower((unsigned char)*str);
+         str++;
+     }
+ 
diff --git a/nss-hg/patches/patch-lib_certhigh_ocsp.c b/nss-hg/patches/patch-lib_certhigh_ocsp.c
new file mode 100644
index 0000000..f24f1ce
--- /dev/null
+++ b/nss-hg/patches/patch-lib_certhigh_ocsp.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Missing ctype(3) casts.
+
+--- lib/certhigh/ocsp.c.orig	2016-01-30 10:42:11.000000000 +0000
++++ lib/certhigh/ocsp.c
+@@ -3569,7 +3569,7 @@ ocsp_UrlEncodeBase64Buf(const char *base
+ 
+     for (walkInput = base64Buf; *walkInput; ++walkInput) {
+         char c = *walkInput;
+-        if (isspace(c))
++        if (isspace((unsigned char)c))
+             continue;
+         switch (c) {
+             case '+':
diff --git a/nss-hg/patches/patch-lib_dbm_src_mktemp.c b/nss-hg/patches/patch-lib_dbm_src_mktemp.c
new file mode 100644
index 0000000..91214dc
--- /dev/null
+++ b/nss-hg/patches/patch-lib_dbm_src_mktemp.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Missing ctype(3) casts.
+
+--- lib/dbm/src/mktemp.c.orig	2016-01-30 10:42:11.000000000 +0000
++++ lib/dbm/src/mktemp.c
+@@ -137,7 +137,7 @@ _gettemp(char *path, register int *doope
+ 			if (*trv == 'z')
+ 				*trv++ = 'a';
+ 			else {
+-				if (isdigit(*trv))
++				if (isdigit((unsigned char)*trv))
+ 					*trv = 'a';
+ 				else
+ 					++*trv;
diff --git a/nss-hg/patches/patch-lib_freebl_mpi_mpi.c b/nss-hg/patches/patch-lib_freebl_mpi_mpi.c
new file mode 100644
index 0000000..ed27c72
--- /dev/null
+++ b/nss-hg/patches/patch-lib_freebl_mpi_mpi.c
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Missing ctype(3) casts.
+
+--- lib/freebl/mpi/mpi.c.orig	2016-01-30 10:42:11.000000000 +0000
++++ lib/freebl/mpi/mpi.c
+@@ -4571,7 +4571,7 @@ int      s_mp_tovalue(char ch, int r)
+   if(r > 36)
+     xch = ch;
+   else
+-    xch = toupper(ch);
++    xch = toupper((unsigned char)ch);
+ 
+   if(isdigit(xch))
+     val = xch - '0';
+@@ -4616,7 +4616,7 @@ char     s_mp_todigit(mp_digit val, int 
+   ch = s_dmap_1[val];
+ 
+   if(r <= 36 && low)
+-    ch = tolower(ch);
++    ch = tolower((unsigned char)ch);
+ 
+   return ch;
+ 
diff --git a/nss-hg/patches/patch-lib_nss_nssinit.c b/nss-hg/patches/patch-lib_nss_nssinit.c
new file mode 100644
index 0000000..74cec41
--- /dev/null
+++ b/nss-hg/patches/patch-lib_nss_nssinit.c
@@ -0,0 +1,36 @@
+$NetBSD$
+
+Missing ctype(3) casts.
+
+--- lib/nss/nssinit.c.orig	2016-01-30 10:42:11.000000000 +0000
++++ lib/nss/nssinit.c
+@@ -1248,25 +1248,25 @@ NSS_VersionCheck(const char *importedVer
+ #define NSS_VERSION_VARIABLE __nss_base_version
+ #include "verref.h"
+ 
+-    while (isdigit(*ptr)) {
++    while (isdigit((unsigned char)*ptr)) {
+         vmajor = 10 * vmajor + *ptr - '0';
+         ptr++;
+     }
+     if (*ptr == '.') {
+         ptr++;
+-        while (isdigit(*ptr)) {
++        while (isdigit((unsigned char)*ptr)) {
+             vminor = 10 * vminor + *ptr - '0';
+             ptr++;
+         }
+         if (*ptr == '.') {
+             ptr++;
+-            while (isdigit(*ptr)) {
++            while (isdigit((unsigned char)*ptr)) {
+                 vpatch = 10 * vpatch + *ptr - '0';
+                 ptr++;
+             }
+             if (*ptr == '.') {
+                 ptr++;
+-                while (isdigit(*ptr)) {
++                while (isdigit((unsigned char)*ptr)) {
+                     vbuild = 10 * vbuild + *ptr - '0';
+                     ptr++;
+                 }
diff --git a/nss-hg/patches/patch-lib_softoken_legacydb_lowcert.c b/nss-hg/patches/patch-lib_softoken_legacydb_lowcert.c
new file mode 100644
index 0000000..60a8af4
--- /dev/null
+++ b/nss-hg/patches/patch-lib_softoken_legacydb_lowcert.c
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Missing ctype(3) casts.
+
+--- lib/softoken/legacydb/lowcert.c.orig	2016-01-30 10:42:11.000000000 +0000
++++ lib/softoken/legacydb/lowcert.c
+@@ -585,7 +585,7 @@ nsslowcert_GetCertificateEmailAddress(NS
+     /* make it lower case */
+     str = emailAddr;
+     while ( str && *str ) {
+-	*str = tolower( *str );
++	*str = tolower( (unsigned char)*str );
+ 	str++;
+     }
+     return emailAddr;
+@@ -689,7 +689,7 @@ nsslowcert_FixupEmailAddr(char *emailAdd
+     
+     /* make it lower case */
+     while ( *str ) {
+-	*str = tolower( *str );
++	*str = tolower( (unsigned char)*str );
+ 	str++;
+     }
+     
diff --git a/nss-hg/patches/patch-lib_util_oidstring.c b/nss-hg/patches/patch-lib_util_oidstring.c
new file mode 100644
index 0000000..afa2cee
--- /dev/null
+++ b/nss-hg/patches/patch-lib_util_oidstring.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Missing ctype(3) casts.
+
+--- lib/util/oidstring.c.orig	2016-01-30 10:42:11.000000000 +0000
++++ lib/util/oidstring.c
+@@ -50,7 +50,7 @@ bad_data:
+     }
+     do {
+ 	PRUint32 decimal = 0;
+-        while (len > 0 && isdigit(*from)) {
++        while (len > 0 && isdigit((unsigned char)*from)) {
+ 	    PRUint32 addend = (*from++ - '0');
+ 	    --len;
+ 	    if (decimal > max_decimal)  /* overflow */
diff --git a/nss-hg/patches/patch-lib_util_portreg.c b/nss-hg/patches/patch-lib_util_portreg.c
new file mode 100644
index 0000000..f739923
--- /dev/null
+++ b/nss-hg/patches/patch-lib_util_portreg.c
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Missing ctype(3) casts.
+
+--- lib/util/portreg.c.orig	2016-01-30 10:42:11.000000000 +0000
++++ lib/util/portreg.c
+@@ -277,7 +277,7 @@ _shexp_match(const char *str, const char
+ 		    if (exp[y] == '\\')
+ 			++y;
+ 		    if(case_insensitive) {
+-			matched |= (toupper(str[x]) == toupper(exp[y]));
++			matched |= (toupper((unsigned char)str[x]) == toupper((unsigned char)exp[y]));
+ 		    } else {
+ 			matched |= (str[x] == exp[y]);
+ 		    }
+@@ -302,7 +302,7 @@ _shexp_match(const char *str, const char
+ 	    /* fall through */
+ 	default:
+ 	    if(case_insensitive) {
+-		if(toupper(str[x]) != toupper(exp[y]))
++		if(toupper((unsigned char)str[x]) != toupper((unsigned char)exp[y]))
+ 		    return NOMATCH;
+ 	    } else {
+ 		if(str[x] != exp[y])
diff --git a/nss-hg/patches/patch-lib_util_utilpars.c b/nss-hg/patches/patch-lib_util_utilpars.c
new file mode 100644
index 0000000..dba0556
--- /dev/null
+++ b/nss-hg/patches/patch-lib_util_utilpars.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Missing ctype(3) casts.
+
+--- lib/util/utilpars.c.orig	2016-01-30 10:42:11.000000000 +0000
++++ lib/util/utilpars.c
+@@ -243,7 +243,7 @@ NSSUTIL_ArgDecodeNumber(const char *num)
+ 
+    
+     for ( ;*num; num++ ) {
+-	if (isdigit(*num)) {
++	if (isdigit((unsigned char)*num)) {
+ 	    digit = *num - '0';
+ 	} else if ((*num >= 'a') && (*num <= 'f'))  {
+ 	    digit = *num - 'a' + 10;
diff --git a/nss-hg/patches/patch-lib_zlib_gzread.c b/nss-hg/patches/patch-lib_zlib_gzread.c
new file mode 100644
index 0000000..1bff2fa
--- /dev/null
+++ b/nss-hg/patches/patch-lib_zlib_gzread.c
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Missing header for read/write/close.
+
+--- lib/zlib/gzread.c.orig	2016-01-30 10:42:11.000000000 +0000
++++ lib/zlib/gzread.c
+@@ -4,6 +4,7 @@
+  */
+ 
+ #include "gzguts.h"
++#include <unistd.h>
+ 
+ /* Local functions */
+ local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *));
diff --git a/nss-hg/patches/patch-lib_zlib_gzwrite.c b/nss-hg/patches/patch-lib_zlib_gzwrite.c
new file mode 100644
index 0000000..0d087f7
--- /dev/null
+++ b/nss-hg/patches/patch-lib_zlib_gzwrite.c
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Missing header for read/write/close.
+
+--- lib/zlib/gzwrite.c.orig	2016-01-30 10:42:11.000000000 +0000
++++ lib/zlib/gzwrite.c
+@@ -4,6 +4,7 @@
+  */
+ 
+ #include "gzguts.h"
++#include <unistd.h>
+ 
+ /* Local functions */
+ local int gz_init OF((gz_statep));


Home | Main Index | Thread Index | Old Index