summaryrefslogtreecommitdiff
path: root/security/nss
diff options
context:
space:
mode:
authornelsonb%netscape.com <devnull@localhost>2004-07-15 22:21:57 +0000
committernelsonb%netscape.com <devnull@localhost>2004-07-15 22:21:57 +0000
commitaf2cd627ef7a1eb4ec3a7b7e85d088af36f3276a (patch)
tree2bf5884934c2b56dd668bb6e27e08bcfb6b9bc2e /security/nss
parente77f4a0ca6250a055612636d5e7b4cd4540dd36c (diff)
downloadnss-hg-af2cd627ef7a1eb4ec3a7b7e85d088af36f3276a.tar.gz
Apply review feedback to signtool sources. Add test case to QA tests.
Bug 248751.
Diffstat (limited to 'security/nss')
-rw-r--r--security/nss/cmd/signtool/sign.c8
-rw-r--r--security/nss/cmd/signtool/signtool.h6
-rw-r--r--security/nss/cmd/signtool/util.c2
-rw-r--r--security/nss/cmd/signtool/zip.c3
-rw-r--r--security/nss/tests/tools/tools.sh24
5 files changed, 34 insertions, 9 deletions
diff --git a/security/nss/cmd/signtool/sign.c b/security/nss/cmd/signtool/sign.c
index 6c06f5e6e..5a9de079f 100644
--- a/security/nss/cmd/signtool/sign.c
+++ b/security/nss/cmd/signtool/sign.c
@@ -451,7 +451,7 @@ manifesto (char *dirname, char *install_script, PRBool recurse)
}
/*
- * m a n i f e s t o _xpi_ f n
+ * m a n i f e s t o _ x p i _ f n
*
* Called by pointer from SignArchive(), once for
* each file within the directory. This function
@@ -462,7 +462,11 @@ static int manifesto_xpi_fn
(char *relpath, char *basedir, char *reldir, char *filename, void *arg)
{
char fullname [FNSIZE];
-
+
+ if(verbosity >= 0) {
+ PR_fprintf(outputFD, "--> %s\n", relpath);
+ }
+
/* extension matching */
if(extensionsGiven) {
char *ext;
diff --git a/security/nss/cmd/signtool/signtool.h b/security/nss/cmd/signtool/signtool.h
index 741fe11be..8e9f1ee59 100644
--- a/security/nss/cmd/signtool/signtool.h
+++ b/security/nss/cmd/signtool/signtool.h
@@ -53,6 +53,7 @@
#include "pk11func.h"
#include "secmod.h"
#include "plhash.h"
+#include "nss.h"
#ifdef _UNIX
#include <unistd.h>
@@ -68,8 +69,8 @@
#define DEFAULT_RSA_KEY_SIZE 1024
#define MANIFEST "manifest.mf"
#define DEFAULT_X509_BASENAME "x509"
-#define DEFAULT_COMMON_NAME "Signtool 3.10 Testing Certificate"
-#define CREATOR "Signtool (signtool 3.10)"
+#define DEFAULT_COMMON_NAME "Signtool " NSS_VERSION " Testing Certificate"
+#define CREATOR "Signtool (signtool " NSS_VERSION ")"
#define BREAKAGE "PLEASE DO NOT EDIT THIS FILE. YOU WILL BREAK IT."
#define MIN_COMPRESSION_LEVEL (-1)
#define MAX_COMPRESSION_LEVEL 9
@@ -78,7 +79,6 @@
#define PROGRAM_NAME "signtool"
#define LONG_PROGRAM_NAME "Signing Tool"
#define DEFAULT_BASE_NAME "zigbert"
-#define VERSION "3.10"
#define TMP_OUTPUT "signtool.tmp"
#define XPI_TEXT "Creating XPI Compatible Archive"
diff --git a/security/nss/cmd/signtool/util.c b/security/nss/cmd/signtool/util.c
index f258d5048..e81163116 100644
--- a/security/nss/cmd/signtool/util.c
+++ b/security/nss/cmd/signtool/util.c
@@ -193,7 +193,7 @@ void
usage (void)
{
PR_fprintf(outputFD, "\n");
- PR_fprintf(outputFD, "%s %s - a signing tool for jar files\n", LONG_PROGRAM_NAME, VERSION);
+ PR_fprintf(outputFD, "%s %s - a signing tool for jar files\n", LONG_PROGRAM_NAME, NSS_VERSION);
PR_fprintf(outputFD, "\n");
PR_fprintf(outputFD, "Usage: %s [options] directory-tree \n\n", PROGRAM_NAME);
PR_fprintf(outputFD, " -b \"basename\"\t\tbasename of .sf, .rsa files for signing\n");
diff --git a/security/nss/cmd/signtool/zip.c b/security/nss/cmd/signtool/zip.c
index f29a51c0b..9df600d26 100644
--- a/security/nss/cmd/signtool/zip.c
+++ b/security/nss/cmd/signtool/zip.c
@@ -67,6 +67,7 @@ JzipOpen(char *filename, char *comment)
(prtime.tm_min<<5) |
(prtime.tm_sec&0x3f);
+ zipfile->fp = NULL;
if (filename &&
(zipfile->fp = PR_Open(filename,
PR_WRONLY|PR_CREATE_FILE|PR_TRUNCATE, 0777)) == NULL) {
@@ -174,6 +175,8 @@ JzipAdd(char *fullname, char *filename, ZIPfile *zipfile, int compression_level)
}
zipfp = zipfile->fp;
+ if (!zipfp)
+ return -1;
if( (readfp = PR_Open(fullname, PR_RDONLY, 0777)) == NULL) {
diff --git a/security/nss/tests/tools/tools.sh b/security/nss/tests/tools/tools.sh
index f029e5ba8..d4a16eec4 100644
--- a/security/nss/tests/tools/tools.sh
+++ b/security/nss/tests/tools/tools.sh
@@ -151,22 +151,40 @@ liz@moz.org
SIGNSCRIPT
html_msg $? 0 "Create objsign cert (signtool -G)"
- echo "$SCRIPTNAME: Signing a set of files ----------------------------"
+ echo "$SCRIPTNAME: Signing a jar of files ----------------------------"
echo "signtool -Z nojs.jar -d ${P_R_ALICEDIR} -p \"nss\" -k objsigner \\"
echo " ${R_TOOLSDIR}/html"
signtool -Z nojs.jar -d ${P_R_ALICEDIR} -p "nss" -k objsigner \
${R_TOOLSDIR}/html
- html_msg $? 0 "Signing a set of files (signtool -Z)"
+ html_msg $? 0 "Signing a jar of files (signtool -Z)"
echo "$SCRIPTNAME: Listing signed files in jar ----------------------"
echo "signtool -v nojs.jar -d ${P_R_ALICEDIR} -p nss -k objsigner"
signtool -v nojs.jar -d ${P_R_ALICEDIR} -p nss -k objsigner
html_msg $? 0 "Listing signed files in jar (signtool -v)"
-
+
echo "$SCRIPTNAME: Show who signed jar ------------------------------"
echo "signtool -w nojs.jar -d ${P_R_ALICEDIR}"
signtool -w nojs.jar -d ${P_R_ALICEDIR}
html_msg $? 0 "Show who signed jar (signtool -w)"
+
+ echo "$SCRIPTNAME: Signing a xpi of files ----------------------------"
+ echo "signtool -Z nojs.xpi -X -d ${P_R_ALICEDIR} -p \"nss\" -k objsigner \\"
+ echo " ${R_TOOLSDIR}/html"
+ signtool -Z nojs.xpi -X -d ${P_R_ALICEDIR} -p "nss" -k objsigner \
+ ${R_TOOLSDIR}/html
+ html_msg $? 0 "Signing a xpi of files (signtool -Z -X)"
+
+ echo "$SCRIPTNAME: Listing signed files in xpi ----------------------"
+ echo "signtool -v nojs.xpi -d ${P_R_ALICEDIR} -p nss -k objsigner"
+ signtool -v nojs.xpi -d ${P_R_ALICEDIR} -p nss -k objsigner
+ html_msg $? 0 "Listing signed files in xpi (signtool -v)"
+
+ echo "$SCRIPTNAME: Show who signed xpi ------------------------------"
+ echo "signtool -w nojs.xpi -d ${P_R_ALICEDIR}"
+ signtool -w nojs.xpi -d ${P_R_ALICEDIR}
+ html_msg $? 0 "Show who signed xpi (signtool -w)"
+
}
############################## tools_cleanup ###########################