| 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 #ifndef PKIM_H | 5 #ifndef PKIM_H |
| 6 #include "pkim.h" | 6 #include "pkim.h" |
| 7 #endif /* PKIM_H */ | 7 #endif /* PKIM_H */ |
| 8 | 8 |
| 9 #ifndef PKIT_H | 9 #ifndef PKIT_H |
| 10 #include "pkit.h" | 10 #include "pkit.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 | 322 |
| 323 NSS_IMPLEMENT void | 323 NSS_IMPLEMENT void |
| 324 nssTrustDomain_RemoveCertFromCacheLOCKED ( | 324 nssTrustDomain_RemoveCertFromCacheLOCKED ( |
| 325 NSSTrustDomain *td, | 325 NSSTrustDomain *td, |
| 326 NSSCertificate *cert | 326 NSSCertificate *cert |
| 327 ) | 327 ) |
| 328 { | 328 { |
| 329 nssList *subjectList; | 329 nssList *subjectList; |
| 330 cache_entry *ce; | 330 cache_entry *ce; |
| 331 NSSArena *arena; | 331 NSSArena *arena; |
| 332 NSSUTF8 *nickname; | 332 NSSUTF8 *nickname = NULL; |
| 333 | 333 |
| 334 #ifdef DEBUG_CACHE | 334 #ifdef DEBUG_CACHE |
| 335 log_cert_ref("attempt to remove cert", cert); | 335 log_cert_ref("attempt to remove cert", cert); |
| 336 #endif | 336 #endif |
| 337 ce = (cache_entry *)nssHash_Lookup(td->cache->issuerAndSN, cert); | 337 ce = (cache_entry *)nssHash_Lookup(td->cache->issuerAndSN, cert); |
| 338 if (!ce || ce->entry.cert != cert) { | 338 if (!ce || ce->entry.cert != cert) { |
| 339 /* If it's not in the cache, or a different cert is (this is really | 339 /* If it's not in the cache, or a different cert is (this is really |
| 340 * for safety reasons, though it shouldn't happen), do nothing | 340 * for safety reasons, though it shouldn't happen), do nothing |
| 341 */ | 341 */ |
| 342 #ifdef DEBUG_CACHE | 342 #ifdef DEBUG_CACHE |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 } | 769 } |
| 770 /* create a new subject list for this cert, or add to existing */ | 770 /* create a new subject list for this cert, or add to existing */ |
| 771 nssrv = add_subject_entry(arena, td->cache, cert, | 771 nssrv = add_subject_entry(arena, td->cache, cert, |
| 772 certNickname, &subjectList); | 772 certNickname, &subjectList); |
| 773 if (nssrv != PR_SUCCESS) { | 773 if (nssrv != PR_SUCCESS) { |
| 774 goto loser; | 774 goto loser; |
| 775 } | 775 } |
| 776 added++; | 776 added++; |
| 777 /* If a new subject entry was created, also need nickname and/or email */ | 777 /* If a new subject entry was created, also need nickname and/or email */ |
| 778 if (subjectList != NULL) { | 778 if (subjectList != NULL) { |
| 779 #ifdef nodef |
| 779 PRBool handle = PR_FALSE; | 780 PRBool handle = PR_FALSE; |
| 781 #endif |
| 780 if (certNickname) { | 782 if (certNickname) { |
| 781 nssrv = add_nickname_entry(arena, td->cache, | 783 nssrv = add_nickname_entry(arena, td->cache, |
| 782 certNickname, subjectList); | 784 certNickname, subjectList); |
| 783 if (nssrv != PR_SUCCESS) { | 785 if (nssrv != PR_SUCCESS) { |
| 784 goto loser; | 786 goto loser; |
| 785 } | 787 } |
| 788 #ifdef nodef |
| 786 handle = PR_TRUE; | 789 handle = PR_TRUE; |
| 790 #endif |
| 787 added++; | 791 added++; |
| 788 } | 792 } |
| 789 if (cert->email) { | 793 if (cert->email) { |
| 790 nssrv = add_email_entry(td->cache, cert, subjectList); | 794 nssrv = add_email_entry(td->cache, cert, subjectList); |
| 791 if (nssrv != PR_SUCCESS) { | 795 if (nssrv != PR_SUCCESS) { |
| 792 goto loser; | 796 goto loser; |
| 793 } | 797 } |
| 798 #ifdef nodef |
| 794 handle = PR_TRUE; | 799 handle = PR_TRUE; |
| 800 #endif |
| 795 added += 2; | 801 added += 2; |
| 796 } | 802 } |
| 797 #ifdef nodef | 803 #ifdef nodef |
| 798 /* I think either a nickname or email address must be associated | 804 /* I think either a nickname or email address must be associated |
| 799 * with the cert. However, certs are passed to NewTemp without | 805 * with the cert. However, certs are passed to NewTemp without |
| 800 * either. This worked in the old code, so it must work now. | 806 * either. This worked in the old code, so it must work now. |
| 801 */ | 807 */ |
| 802 if (!handle) { | 808 if (!handle) { |
| 803 /* Require either nickname or email handle */ | 809 /* Require either nickname or email handle */ |
| 804 nssrv = PR_FAILURE; | 810 nssrv = PR_FAILURE; |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 nssTrustDomain_DumpCacheInfo ( | 1124 nssTrustDomain_DumpCacheInfo ( |
| 1119 NSSTrustDomain *td, | 1125 NSSTrustDomain *td, |
| 1120 void (* cert_dump_iter)(const void *, void *, void *), | 1126 void (* cert_dump_iter)(const void *, void *, void *), |
| 1121 void *arg | 1127 void *arg |
| 1122 ) | 1128 ) |
| 1123 { | 1129 { |
| 1124 PZ_Lock(td->cache->lock); | 1130 PZ_Lock(td->cache->lock); |
| 1125 nssHash_Iterate(td->cache->issuerAndSN, cert_dump_iter, arg); | 1131 nssHash_Iterate(td->cache->issuerAndSN, cert_dump_iter, arg); |
| 1126 PZ_Unlock(td->cache->lock); | 1132 PZ_Unlock(td->cache->lock); |
| 1127 } | 1133 } |
| OLD | NEW |