diff options
author | mcgreer%netscape.com <devnull@localhost> | 2000-10-11 00:55:45 +0000 |
---|---|---|
committer | mcgreer%netscape.com <devnull@localhost> | 2000-10-11 00:55:45 +0000 |
commit | d640359cde873e30417590c7a45868aa169677e8 (patch) | |
tree | bfb2bc75e500104645bd6ef342d747788b10ac63 | |
parent | da6d368ae78f83a0d40ca481864248359129726a (diff) | |
download | nss-hg-d640359cde873e30417590c7a45868aa169677e8.tar.gz |
seperate text file reads from binary reads. Change all base64 encoded ciphertexts to end in LF instead of CRLF. This caused a bug on windows when checking out from CVS.
-rw-r--r-- | security/nss/cmd/bltest/blapitest.c | 29 | ||||
-rw-r--r-- | security/nss/cmd/bltest/tests/des3_cbc/ciphertext0 | 2 | ||||
-rw-r--r-- | security/nss/cmd/bltest/tests/des3_ecb/ciphertext0 | 2 | ||||
-rw-r--r-- | security/nss/cmd/bltest/tests/des_cbc/ciphertext0 | 2 | ||||
-rw-r--r-- | security/nss/cmd/bltest/tests/des_ecb/ciphertext0 | 2 | ||||
-rw-r--r-- | security/nss/cmd/bltest/tests/dsa/ciphertext0 | 2 | ||||
-rw-r--r-- | security/nss/cmd/bltest/tests/md2/ciphertext0 | 2 | ||||
-rw-r--r-- | security/nss/cmd/bltest/tests/md5/ciphertext0 | 2 | ||||
-rw-r--r-- | security/nss/cmd/bltest/tests/rc2_cbc/ciphertext0 | 2 | ||||
-rw-r--r-- | security/nss/cmd/bltest/tests/rc2_ecb/ciphertext0 | 2 | ||||
-rw-r--r-- | security/nss/cmd/bltest/tests/rc4/ciphertext0 | 2 | ||||
-rw-r--r-- | security/nss/cmd/bltest/tests/rc4/ciphertext1 | 2 | ||||
-rw-r--r-- | security/nss/cmd/bltest/tests/rc5_cbc/ciphertext0 | 2 | ||||
-rw-r--r-- | security/nss/cmd/bltest/tests/rc5_ecb/ciphertext0 | 2 | ||||
-rw-r--r-- | security/nss/cmd/bltest/tests/rsa/ciphertext0 | 2 | ||||
-rw-r--r-- | security/nss/cmd/bltest/tests/sha1/ciphertext0 | 2 |
16 files changed, 28 insertions, 31 deletions
diff --git a/security/nss/cmd/bltest/blapitest.c b/security/nss/cmd/bltest/blapitest.c index 91d83dc2c..0461c3b2a 100644 --- a/security/nss/cmd/bltest/blapitest.c +++ b/security/nss/cmd/bltest/blapitest.c @@ -1485,20 +1485,18 @@ get_ascii_file_data(SECItem *item, char *mode, char *type, int num) SECStatus rv; sprintf(filename, "%s/tests/%s/%s%d", testdir, mode, type, num); file = PR_Open(filename, PR_RDONLY, 00440); - if (file) { - rv = SECU_FileToItem(item, file); - } else { + if (!file) { /* Not a failure if "mode" does not need "type". */ return SECSuccess; } - if ((PL_strcmp(mode, "rsa") == 0 || PL_strcmp(mode, "dsa") == 0) && - PL_strcmp(type, "key") == 0) - atob(SECITEM_DupItem(item), item); - if (PL_strcmp(mode, "dsa") == 0 && PL_strcmp(type, "plaintext") == 0) + if (((PL_strcmp(mode, "rsa") == 0 || PL_strcmp(mode, "dsa") == 0) && + PL_strcmp(type, "key") == 0) || + (PL_strcmp(mode, "dsa") == 0 && PL_strcmp(type, "plaintext") == 0)) { + rv = SECU_FileToItem(item, file); atob(SECITEM_DupItem(item), item); - /* remove a trailing newline, else byte count will be wrong */ - if (item->data[item->len-1] == '\n') - item->len--; + } else { + rv = SECU_TextFileToItem(item, file); + } PR_Close(file); return rv; } @@ -1625,15 +1623,14 @@ get_file_data(char *filename, SECItem *item, PRBool b64) SECStatus rv = SECSuccess; PRFileDesc *file = PR_Open(filename, PR_RDONLY, 006600); if (file) { - SECItem asciiItem = { 0, 0, 0 }; - rv = SECU_FileToItem(&asciiItem, file); - CHECKERROR(rv, __LINE__); if (b64) { + SECItem asciiItem = { 0, 0, 0 }; + rv = SECU_FileToItem(&asciiItem, file); + CHECKERROR(rv, __LINE__); rv = atob(&asciiItem, item); } else { - SECITEM_CopyItem(NULL, item, &asciiItem); - if (item->data[item->len-1] == '\n') - item->len--; + rv = SECU_FileToItem(item, file); + CHECKERROR(rv, __LINE__); } CHECKERROR(rv, __LINE__); PR_Close(file); diff --git a/security/nss/cmd/bltest/tests/des3_cbc/ciphertext0 b/security/nss/cmd/bltest/tests/des3_cbc/ciphertext0 index b5b78e440..61dae3192 100644 --- a/security/nss/cmd/bltest/tests/des3_cbc/ciphertext0 +++ b/security/nss/cmd/bltest/tests/des3_cbc/ciphertext0 @@ -1 +1 @@ -KV3MDNGKWOc=
+KV3MDNGKWOc= diff --git a/security/nss/cmd/bltest/tests/des3_ecb/ciphertext0 b/security/nss/cmd/bltest/tests/des3_ecb/ciphertext0 index 7bdcde21d..76dc820d3 100644 --- a/security/nss/cmd/bltest/tests/des3_ecb/ciphertext0 +++ b/security/nss/cmd/bltest/tests/des3_ecb/ciphertext0 @@ -1 +1 @@ -RgckVNh4QcM=
+RgckVNh4QcM= diff --git a/security/nss/cmd/bltest/tests/des_cbc/ciphertext0 b/security/nss/cmd/bltest/tests/des_cbc/ciphertext0 index 56acfeeaf..67d2ad1aa 100644 --- a/security/nss/cmd/bltest/tests/des_cbc/ciphertext0 +++ b/security/nss/cmd/bltest/tests/des_cbc/ciphertext0 @@ -1 +1 @@ -Perdg9FMYQ4=
+Perdg9FMYQ4= diff --git a/security/nss/cmd/bltest/tests/des_ecb/ciphertext0 b/security/nss/cmd/bltest/tests/des_ecb/ciphertext0 index 86ed115a1..8be22fa5c 100644 --- a/security/nss/cmd/bltest/tests/des_ecb/ciphertext0 +++ b/security/nss/cmd/bltest/tests/des_ecb/ciphertext0 @@ -1 +1 @@ -3bNoWzzNiFc=
+3bNoWzzNiFc= diff --git a/security/nss/cmd/bltest/tests/dsa/ciphertext0 b/security/nss/cmd/bltest/tests/dsa/ciphertext0 index f3c84a5f2..8e7150562 100644 --- a/security/nss/cmd/bltest/tests/dsa/ciphertext0 +++ b/security/nss/cmd/bltest/tests/dsa/ciphertext0 @@ -1 +1 @@ -fB0bnKWvjT6X5NIkZ5l/Y/DXZ6QNI6j0iPhR/ZERkfj67xRnTWY1cg==
+fB0bnKWvjT6X5NIkZ5l/Y/DXZ6QNI6j0iPhR/ZERkfj67xRnTWY1cg== diff --git a/security/nss/cmd/bltest/tests/md2/ciphertext0 b/security/nss/cmd/bltest/tests/md2/ciphertext0 index 0b7bc262f..22e1fc496 100644 --- a/security/nss/cmd/bltest/tests/md2/ciphertext0 +++ b/security/nss/cmd/bltest/tests/md2/ciphertext0 @@ -1 +1 @@ -CS/UNcrWhB5Knt7Gf8Tz3Q==
+CS/UNcrWhB5Knt7Gf8Tz3Q== diff --git a/security/nss/cmd/bltest/tests/md5/ciphertext0 b/security/nss/cmd/bltest/tests/md5/ciphertext0 index 7bb485d01..ea11ee523 100644 --- a/security/nss/cmd/bltest/tests/md5/ciphertext0 +++ b/security/nss/cmd/bltest/tests/md5/ciphertext0 @@ -1 +1 @@ -XN8lnQuWAiMqmSGfvd8Hdw==
+XN8lnQuWAiMqmSGfvd8Hdw== diff --git a/security/nss/cmd/bltest/tests/rc2_cbc/ciphertext0 b/security/nss/cmd/bltest/tests/rc2_cbc/ciphertext0 index 91ddac381..d964ef864 100644 --- a/security/nss/cmd/bltest/tests/rc2_cbc/ciphertext0 +++ b/security/nss/cmd/bltest/tests/rc2_cbc/ciphertext0 @@ -1 +1 @@ -3ki6eVsWpY8=
+3ki6eVsWpY8= diff --git a/security/nss/cmd/bltest/tests/rc2_ecb/ciphertext0 b/security/nss/cmd/bltest/tests/rc2_ecb/ciphertext0 index c569f4dbd..337d30765 100644 --- a/security/nss/cmd/bltest/tests/rc2_ecb/ciphertext0 +++ b/security/nss/cmd/bltest/tests/rc2_ecb/ciphertext0 @@ -1 +1 @@ -WT+tc4fANhQ=
+WT+tc4fANhQ= diff --git a/security/nss/cmd/bltest/tests/rc4/ciphertext0 b/security/nss/cmd/bltest/tests/rc4/ciphertext0 index e0c2147dc..004f13472 100644 --- a/security/nss/cmd/bltest/tests/rc4/ciphertext0 +++ b/security/nss/cmd/bltest/tests/rc4/ciphertext0 @@ -1 +1 @@ -34sTZJtr20k=
+34sTZJtr20k= diff --git a/security/nss/cmd/bltest/tests/rc4/ciphertext1 b/security/nss/cmd/bltest/tests/rc4/ciphertext1 index 21e0026fa..6050da4c6 100644 --- a/security/nss/cmd/bltest/tests/rc4/ciphertext1 +++ b/security/nss/cmd/bltest/tests/rc4/ciphertext1 @@ -1 +1 @@ -34sTZJtr20nGP6VxS3BIBxxIYm6QGIa1rehFHn51z9M=
+34sTZJtr20nGP6VxS3BIBxxIYm6QGIa1rehFHn51z9M= diff --git a/security/nss/cmd/bltest/tests/rc5_cbc/ciphertext0 b/security/nss/cmd/bltest/tests/rc5_cbc/ciphertext0 index 2c5ae7e44..544713b33 100644 --- a/security/nss/cmd/bltest/tests/rc5_cbc/ciphertext0 +++ b/security/nss/cmd/bltest/tests/rc5_cbc/ciphertext0 @@ -1 +1 @@ -qsv4Fn2J6d0=
+qsv4Fn2J6d0= diff --git a/security/nss/cmd/bltest/tests/rc5_ecb/ciphertext0 b/security/nss/cmd/bltest/tests/rc5_ecb/ciphertext0 index 67c88bc8a..133777dd0 100644 --- a/security/nss/cmd/bltest/tests/rc5_ecb/ciphertext0 +++ b/security/nss/cmd/bltest/tests/rc5_ecb/ciphertext0 @@ -1 +1 @@ -4ZKK/1v5Ohc=
+4ZKK/1v5Ohc= diff --git a/security/nss/cmd/bltest/tests/rsa/ciphertext0 b/security/nss/cmd/bltest/tests/rsa/ciphertext0 index e6357efd7..943ea599a 100644 --- a/security/nss/cmd/bltest/tests/rsa/ciphertext0 +++ b/security/nss/cmd/bltest/tests/rsa/ciphertext0 @@ -1 +1 @@ -qPVrXv0y3SC5rY44bIi6GE4Aec8uDpHH7/cCg0FU5as=
+qPVrXv0y3SC5rY44bIi6GE4Aec8uDpHH7/cCg0FU5as= diff --git a/security/nss/cmd/bltest/tests/sha1/ciphertext0 b/security/nss/cmd/bltest/tests/sha1/ciphertext0 index a33d020cd..1fe4bd2bd 100644 --- a/security/nss/cmd/bltest/tests/sha1/ciphertext0 +++ b/security/nss/cmd/bltest/tests/sha1/ciphertext0 @@ -1 +1 @@ -cDSMAygXMPIJZC5bntZ4ZhecQ9g=
+cDSMAygXMPIJZC5bntZ4ZhecQ9g= |