summaryrefslogtreecommitdiff
path: root/security/nss/cmd/certcgi
diff options
context:
space:
mode:
authornelsonb%netscape.com <devnull@localhost>2001-10-11 22:29:42 +0000
committernelsonb%netscape.com <devnull@localhost>2001-10-11 22:29:42 +0000
commite047592a35d29432be145d321583dcf3e9b8eef8 (patch)
tree360ad3ccb17ccdf14dce7af3e0156c71cef6a498 /security/nss/cmd/certcgi
parentaa005715b66cabf411686ab06b714a47e307f184 (diff)
downloadnss-hg-e047592a35d29432be145d321583dcf3e9b8eef8.tar.gz
Get the test CA program working again. Remove some bogus scripts.
Diffstat (limited to 'security/nss/cmd/certcgi')
-rw-r--r--security/nss/cmd/certcgi/ca_form.html4
-rw-r--r--security/nss/cmd/certcgi/certcgi.c45
-rw-r--r--security/nss/cmd/certcgi/index.html2
-rw-r--r--security/nss/cmd/certcgi/main.html2
-rw-r--r--security/nss/cmd/certcgi/nscp_ext_form.html2
-rw-r--r--security/nss/cmd/certcgi/stnd_ext_form.html2
6 files changed, 28 insertions, 29 deletions
diff --git a/security/nss/cmd/certcgi/ca_form.html b/security/nss/cmd/certcgi/ca_form.html
index 6858903a6..43042cb64 100644
--- a/security/nss/cmd/certcgi/ca_form.html
+++ b/security/nss/cmd/certcgi/ca_form.html
@@ -31,7 +31,7 @@
- may use your version of this file under either the MPL or the
- GPL.
-->
- <form method="post" name="primary_form" action="http://troll.mcom.com/jsw/cgi-bin/echoform.cgi">
+ <form method="post" name="primary_form" action="http://interzone.mcom.com/burp.cgi">
<table border=0 cellspacing=10 cellpadding=0>
<tr>
<td>
@@ -168,7 +168,7 @@
<hr>
</p>
<table border=1 cellspacing=5 cellpadding=5>
- <form method="post" name="primary_form" action="http://troll.mcom.com/jsw/cgi-bin/echoform.cgi">
+ <form method="post" name="primary_form" action="http://interzone.mcom.com/burp.cgi">
<tr>
<td>
<b>Key Usage: </b></p>
diff --git a/security/nss/cmd/certcgi/certcgi.c b/security/nss/cmd/certcgi/certcgi.c
index 725e6ffad..12ca158bd 100644
--- a/security/nss/cmd/certcgi/certcgi.c
+++ b/security/nss/cmd/certcgi/certcgi.c
@@ -1060,8 +1060,8 @@ AddPrivKeyUsagePeriod(void *extHandle,
if (pkup == NULL) {
error_allocate();
}
- notBeforeStr = (char *) PORT_Alloc(16 * sizeof(char));
- notAfterStr = (char *) PORT_Alloc(16 * sizeof(char));
+ notBeforeStr = (char *) PORT_Alloc(16 );
+ notAfterStr = (char *) PORT_Alloc(16 );
*notBeforeStr = '\0';
*notAfterStr = '\0';
pkup->arena = arena;
@@ -2109,7 +2109,7 @@ return_dbpasswd(PK11SlotInfo *slot, PRBool retry, void *data)
if (retry == PR_TRUE) {
return NULL;
}
- rv = PORT_Alloc(sizeof(char) * 4);
+ rv = PORT_Alloc(4);
PORT_Strcpy(rv, "foo");
return rv;
}
@@ -2121,14 +2121,26 @@ FindPrivateKeyFromNameStr(char *name,
{
SECKEYPrivateKey *key;
CERTCertificate *cert;
+ CERTCertificate *p11Cert;
SECStatus status = SECSuccess;
+ /* We don't presently have a PK11 function to find a cert by
+ ** subject name.
+ ** We do have a function to find a cert in the internal slot's
+ ** cert db by subject name, but it doesn't setup the slot info.
+ ** So, this HACK works, but should be replaced as soon as we
+ ** have a function to search for certs accross slots by subject name.
+ */
cert = CERT_FindCertByNameString(certHandle, name);
- if (cert == NULL) {
+ if (cert == NULL || cert->nickname == NULL) {
error_out("ERROR: Unable to retrieve issuers certificate");
}
- key = PK11_FindKeyByAnyCert(cert, NULL);
+ p11Cert = PK11_FindCertFromNickname(cert->nickname, NULL);
+ if (p11Cert == NULL) {
+ error_out("ERROR: Unable to retrieve issuers certificate");
+ }
+ key = PK11_FindKeyByAnyCert(p11Cert, NULL);
return key;
}
@@ -2245,13 +2257,10 @@ main(int argc, char **argv)
#ifdef TEST
sleep(20);
#endif
- RNG_SystemInfoForRNG();
SECU_ConfigDirectory(DBdir);
- PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1);
-
PK11_SetPasswordFunc(return_dbpasswd);
- NSS_InitReadWrite(DBdir);
+ status = NSS_InitReadWrite(DBdir);
if (status != SECSuccess) {
SECU_PrintPRandOSError(progName);
return -1;
@@ -2275,7 +2284,7 @@ main(int argc, char **argv)
}
pos = form_output + length - remaining;
}
- n = fread(pos, sizeof(char), (size_t) (remaining - 1), stdin);
+ n = fread(pos, 1, (size_t) (remaining - 1), stdin);
pos += n;
remaining -= n;
}
@@ -2287,11 +2296,11 @@ main(int argc, char **argv)
#endif
#ifdef FILEOUT
printf("Content-type: text/plain\n\n");
- fwrite(form_output, sizeof(char), (size_t)length, stdout);
+ fwrite(form_output, 1, (size_t)length, stdout);
printf("\n");
#endif
#ifdef FILEOUT
- fwrite(form_output, sizeof(char), (size_t)length, stdout);
+ fwrite(form_output, 1, (size_t)length, stdout);
printf("\n");
fflush(stdout);
#endif
@@ -2312,7 +2321,7 @@ main(int argc, char **argv)
printf("I got that done, woo hoo\n");
fflush(stdout);
#endif
- issuerNameStr = PORT_Alloc(35 * sizeof(char));
+ issuerNameStr = PORT_Alloc(200);
if (find_field_bool(form_data, "caChoiceradio-SignWithSpecifiedChain",
PR_FALSE)) {
UChain = PR_TRUE;
@@ -2417,13 +2426,3 @@ main(int argc, char **argv)
return 0;
}
-
-
-
-
-
-
-
-
-
-
diff --git a/security/nss/cmd/certcgi/index.html b/security/nss/cmd/certcgi/index.html
index d7a80d7a2..0bd79f3ce 100644
--- a/security/nss/cmd/certcgi/index.html
+++ b/security/nss/cmd/certcgi/index.html
@@ -35,7 +35,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<SCRIPT LANGUAGE="JavaScript1.2">
-script_url = 'http://troll.mcom.com/certo/production/cgi-bin/certcgi.cgi'
+script_url = 'http://interzone.mcom.com/cgi-bin/certomatic/bin/certcgi.cgi'
ext_page_ver1 =
make_page_intro('Version 1 extensions', "#FFFFFF") +
diff --git a/security/nss/cmd/certcgi/main.html b/security/nss/cmd/certcgi/main.html
index 2c47a8b76..34667b46a 100644
--- a/security/nss/cmd/certcgi/main.html
+++ b/security/nss/cmd/certcgi/main.html
@@ -35,7 +35,7 @@
<TITLE>Main Layer for CertOMatic</TITLE>
</HEAD>
- <form method="post" name="primary_form" action="http://troll.mcom.com/jsw/cgi-bin/echoform.cgi">
+ <form method="post" name="primary_form" action="http://interzone.mcom.com/burp.cgi">
<table border=0 cellspacing=10 cellpadding=0>
<tr>
<td>
diff --git a/security/nss/cmd/certcgi/nscp_ext_form.html b/security/nss/cmd/certcgi/nscp_ext_form.html
index b0d385534..de939eecb 100644
--- a/security/nss/cmd/certcgi/nscp_ext_form.html
+++ b/security/nss/cmd/certcgi/nscp_ext_form.html
@@ -35,7 +35,7 @@
<body>
<table border=1 cellspacing=5 cellpadding=5>
- <form method="post" name="primary_form" action="http://troll.mcom.com/jsw/cgi-bin/echoform.cgi">
+ <form method="post" name="primary_form" action="http://interzone.mcom.com/burp.cgi">
<tr>
<td>
<b>Netscape Certificate Type: </b></p>
diff --git a/security/nss/cmd/certcgi/stnd_ext_form.html b/security/nss/cmd/certcgi/stnd_ext_form.html
index 26868c62c..ece9b2ff7 100644
--- a/security/nss/cmd/certcgi/stnd_ext_form.html
+++ b/security/nss/cmd/certcgi/stnd_ext_form.html
@@ -35,7 +35,7 @@
<body>
<table border=1 cellspacing=5 cellpadding=5>
- <form method="post" name="primary_form" action="http://troll.mcom.com/jsw/cgi-bin/echoform.cgi">
+ <form method="post" name="primary_form" action="http://interzone.mcom.com/burp.cgi">
<tr>
<td>
<b>Key Usage: </b></p>