diff cinst/mozilla.c @ 268:a7c6a21aba38

Simplification, import DER cert directly to store.
author Sascha Wilde <wilde@intevation.de>
date Tue, 01 Apr 2014 19:10:05 +0200
parents 1fa607af6332
children f7471604bb31
line wrap: on
line diff
--- a/cinst/mozilla.c	Tue Apr 01 17:39:11 2014 +0200
+++ b/cinst/mozilla.c	Tue Apr 01 19:10:05 2014 +0200
@@ -445,7 +445,6 @@
   SECItem *secitemp;
   SECStatus rv;
   PK11SlotInfo *pk11slot = NULL;
-  CERTCertificate *cert = NULL;
   char *cert_name;
 
   pdirs =
@@ -477,14 +476,11 @@
                   == SECSuccess)
                 {
                   pk11slot = PK11_GetInternalKeySlot();
-                  cert = CERT_DecodeCertFromPackage((char *)secitemp->data, (int)secitemp->len);
-                  rv = PK11_ImportCert(pk11slot, cert, CK_INVALID_HANDLE, cert_name, PR_FALSE);
+                  rv = PK11_ImportDERCert(pk11slot, secitemp, CK_INVALID_HANDLE, cert_name, PR_FALSE);
                   if (rv != SECSuccess) {
                     DEBUGPRINTF("Failed to install certificate '%s' to '%s'!\n", cert_name, pdirs[i]);
                     DEBUGPRINTF("Error was %d\n", rv);
                   }
-                  CERT_DestroyCertificate(cert);
-                  cert = NULL;
                   PK11_FreeSlot(pk11slot);
                   NSS_Shutdown();
                 }

http://wald.intevation.org/projects/trustbridge/