OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | 4 |
5 /* | 5 /* |
6 * Hacks to integrate NSS 3.4 and NSS 4.0 certificates. | 6 * Hacks to integrate NSS 3.4 and NSS 4.0 certificates. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef NSSPKI_H | 9 #ifndef NSSPKI_H |
10 #include "nsspki.h" | 10 #include "nsspki.h" |
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 /* trust */ | 823 /* trust */ |
824 trust = nssTrust_GetCERTCertTrustForCert(c, cc); | 824 trust = nssTrust_GetCERTCertTrustForCert(c, cc); |
825 if (trust) { | 825 if (trust) { |
826 /* we should destroy cc->trust before replacing it, but it's | 826 /* we should destroy cc->trust before replacing it, but it's |
827 allocated in cc->arena, so memory growth will occur on each | 827 allocated in cc->arena, so memory growth will occur on each |
828 refresh */ | 828 refresh */ |
829 CERT_LockCertTrust(cc); | 829 CERT_LockCertTrust(cc); |
830 cc->trust = trust; | 830 cc->trust = trust; |
831 CERT_UnlockCertTrust(cc); | 831 CERT_UnlockCertTrust(cc); |
832 } | 832 } |
| 833 } |
| 834 if (instance) { |
833 nssCryptokiObject_Destroy(instance); | 835 nssCryptokiObject_Destroy(instance); |
834 } | 836 } |
835 /* database handle is now the trust domain */ | 837 /* database handle is now the trust domain */ |
836 cc->dbhandle = c->object.trustDomain; | 838 cc->dbhandle = c->object.trustDomain; |
837 /* subjectList ? */ | 839 /* subjectList ? */ |
838 /* istemp and isperm are supported in NSS 3.4 */ | 840 /* istemp and isperm are supported in NSS 3.4 */ |
839 cc->istemp = PR_FALSE; /* CERT_NewTemp will override this */ | 841 cc->istemp = PR_FALSE; /* CERT_NewTemp will override this */ |
840 cc->isperm = PR_TRUE; /* by default */ | 842 cc->isperm = PR_TRUE; /* by default */ |
841 /* pointer back */ | 843 /* pointer back */ |
842 cc->nssCertificate = c; | 844 cc->nssCertificate = c; |
843 if (trust) { | 845 if (trust) { |
844 /* force the cert type to be recomputed to include trust info */ | 846 /* force the cert type to be recomputed to include trust info */ |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1431 td = STAN_GetDefaultTrustDomain(); | 1433 td = STAN_GetDefaultTrustDomain(); |
1432 cc = STAN_GetDefaultCryptoContext(); | 1434 cc = STAN_GetDefaultCryptoContext(); |
1433 printf("\n\nCertificates in the cache:\n"); | 1435 printf("\n\nCertificates in the cache:\n"); |
1434 nssTrustDomain_DumpCacheInfo(td, cert_dump_iter, NULL); | 1436 nssTrustDomain_DumpCacheInfo(td, cert_dump_iter, NULL); |
1435 printf("\n\nCertificates in the temporary store:\n"); | 1437 printf("\n\nCertificates in the temporary store:\n"); |
1436 if (cc->certStore) { | 1438 if (cc->certStore) { |
1437 nssCertificateStore_DumpStoreInfo(cc->certStore, cert_dump_iter, NULL); | 1439 nssCertificateStore_DumpStoreInfo(cc->certStore, cert_dump_iter, NULL); |
1438 } | 1440 } |
1439 } | 1441 } |
1440 | 1442 |
OLD | NEW |