summaryrefslogtreecommitdiff
path: root/security/nss/cmd/checkcert
diff options
context:
space:
mode:
authornelsonb%netscape.com <devnull@localhost>2001-01-07 08:13:13 +0000
committernelsonb%netscape.com <devnull@localhost>2001-01-07 08:13:13 +0000
commit09bcb513a27be8edb6e06c9e92564c66eb948aab (patch)
treed29b00b8add7f177020b5d071fb45be6d669312f /security/nss/cmd/checkcert
parent33fa5f1efdab14c312b73593860b9b497310bd3f (diff)
downloadnss-hg-09bcb513a27be8edb6e06c9e92564c66eb948aab.tar.gz
MSVC won't let you initialize a pointer in a data structure with the
address of an external variable that comes from another DLL. This is a fundamental difference between WIN32 DLLs and Unix DSOs. So, for every SEC_ASN1Template inside of libnss3 that is referenced by other templates outside of libnss3, a new "chooser" function was created that returns the address of that template. For WIN32, the templates outside of libnss3 access libnss3's templates by the chooser function rather than by direct reference. Some simple macros allow Unix to continue to use direct references, avoiding the extra function calls. With these changes, all.sh (qa script) passes all tests on NT with DLLs. Modified Files: cmd/checkcert/checkcert.c cmd/lib/secutil.c lib/asn1/asn1t.h lib/certdb/certdb.c lib/certdb/certt.h lib/certdb/crl.c lib/certhigh/certreq.c lib/crmf/asn1cmn.c lib/crmf/crmfcont.c lib/crmf/crmftmpl.c lib/cryptohi/secsign.c lib/nss/nss.def lib/pkcs12/p12local.c lib/pkcs12/p12tmpl.c lib/pkcs7/certread.c lib/pkcs7/p7decode.c lib/pkcs7/p7local.c lib/smime/cmsasn1.c lib/smime/cmsattr.c lib/smime/cmspubkey.c lib/smime/cmssigdata.c lib/smime/smimeutil.c lib/softoken/keydb.c lib/softoken/keydbt.h lib/util/secalgid.c lib/util/secasn1.h lib/util/secasn1d.c lib/util/secasn1t.h lib/util/secasn1u.c lib/util/secdig.c lib/util/secdig.h lib/util/secoid.h
Diffstat (limited to 'security/nss/cmd/checkcert')
-rw-r--r--security/nss/cmd/checkcert/checkcert.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/security/nss/cmd/checkcert/checkcert.c b/security/nss/cmd/checkcert/checkcert.c
index 887263aeb..0cd5e61aa 100644
--- a/security/nss/cmd/checkcert/checkcert.c
+++ b/security/nss/cmd/checkcert/checkcert.c
@@ -406,7 +406,8 @@ int main(int argc, char **argv)
fprintf(stderr,"%s: can't allocate issuer signed data!", progName);
exit(1);
}
- rv = SEC_ASN1DecodeItem(arena, issuerCertSD, CERT_SignedDataTemplate,
+ rv = SEC_ASN1DecodeItem(arena, issuerCertSD,
+ SEC_ASN1_GET(CERT_SignedDataTemplate),
&derIssuerCert);
if (rv) {
fprintf(stderr, "%s: Issuer cert isn't X509 SIGNED Data?\n",
@@ -418,7 +419,8 @@ int main(int argc, char **argv)
printf("%s: can't allocate space for issuer cert.", progName);
exit(1);
}
- rv = SEC_ASN1DecodeItem(arena, issuerCert, CERT_CertificateTemplate,
+ rv = SEC_ASN1DecodeItem(arena, issuerCert,
+ SEC_ASN1_GET(CERT_CertificateTemplate),
&issuerCertSD->data);
if (rv) {
printf("%s: Does not appear to be an X509 Certificate.\n",
@@ -433,7 +435,8 @@ int main(int argc, char **argv)
exit(1);
}
- rv = SEC_ASN1DecodeItem(arena, signedData, CERT_SignedDataTemplate,
+ rv = SEC_ASN1DecodeItem(arena, signedData,
+ SEC_ASN1_GET(CERT_SignedDataTemplate),
&derCert);
if (rv) {
fprintf(stderr, "%s: Does not appear to be X509 SIGNED Data.\n",
@@ -451,7 +454,8 @@ int main(int argc, char **argv)
exit(1);
}
- rv = SEC_ASN1DecodeItem(arena, cert, CERT_CertificateTemplate,
+ rv = SEC_ASN1DecodeItem(arena, cert,
+ SEC_ASN1_GET(CERT_CertificateTemplate),
&signedData->data);
if (rv) {
fprintf(stderr, "%s: Does not appear to be an X509 Certificate.\n",
@@ -540,8 +544,8 @@ int main(int argc, char **argv)
exit(1);
}
- rv = SEC_ASN1DecodeItem(arena, rsapubkey, SECKEY_RSAPublicKeyTemplate,
- &spk);
+ rv = SEC_ASN1DecodeItem(arena, rsapubkey,
+ SEC_ASN1_GET(SECKEY_RSAPublicKeyTemplate), &spk);
if (rv) {
printf("PROBLEM: subjectPublicKey is not a DER PKCS1 RSAPublicKey.\n");
} else {