| 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 DEV_H | 5 #ifndef DEV_H |
| 6 #include "dev.h" | 6 #include "dev.h" |
| 7 #endif /* DEV_H */ | 7 #endif /* DEV_H */ |
| 8 | 8 |
| 9 #ifndef PKIM_H | 9 #ifndef PKIM_H |
| 10 #include "pkim.h" | 10 #include "pkim.h" |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 NSS_IMPLEMENT NSSCertificate * | 824 NSS_IMPLEMENT NSSCertificate * |
| 825 nssTrustDomain_FindCertificateByEncodedCertificate ( | 825 nssTrustDomain_FindCertificateByEncodedCertificate ( |
| 826 NSSTrustDomain *td, | 826 NSSTrustDomain *td, |
| 827 NSSBER *ber | 827 NSSBER *ber |
| 828 ) | 828 ) |
| 829 { | 829 { |
| 830 PRStatus status; | 830 PRStatus status; |
| 831 NSSCertificate *rvCert = NULL; | 831 NSSCertificate *rvCert = NULL; |
| 832 NSSDER issuer = { 0 }; | 832 NSSDER issuer = { 0 }; |
| 833 NSSDER serial = { 0 }; | 833 NSSDER serial = { 0 }; |
| 834 NSSArena *arena = nssArena_Create(); | |
| 835 if (!arena) { | |
| 836 return (NSSCertificate *)NULL; | |
| 837 } | |
| 838 /* XXX this is not generic... will any cert crack into issuer/serial? */ | 834 /* XXX this is not generic... will any cert crack into issuer/serial? */ |
| 839 status = nssPKIX509_GetIssuerAndSerialFromDER(ber, arena, &issuer, &serial); | 835 status = nssPKIX509_GetIssuerAndSerialFromDER(ber, &issuer, &serial); |
| 840 if (status != PR_SUCCESS) { | 836 if (status != PR_SUCCESS) { |
| 841 » goto finish; | 837 » return NULL; |
| 842 } | 838 } |
| 843 rvCert = nssTrustDomain_FindCertificateByIssuerAndSerialNumber(td, | 839 rvCert = nssTrustDomain_FindCertificateByIssuerAndSerialNumber(td, |
| 844 &issuer, | 840 &issuer, |
| 845 &serial); | 841 &serial); |
| 846 finish: | 842 PORT_Free(issuer.data); |
| 847 nssArena_Destroy(arena); | 843 PORT_Free(serial.data); |
| 848 return rvCert; | 844 return rvCert; |
| 849 } | 845 } |
| 850 | 846 |
| 851 NSS_IMPLEMENT NSSCertificate * | 847 NSS_IMPLEMENT NSSCertificate * |
| 852 NSSTrustDomain_FindCertificateByEncodedCertificate ( | 848 NSSTrustDomain_FindCertificateByEncodedCertificate ( |
| 853 NSSTrustDomain *td, | 849 NSSTrustDomain *td, |
| 854 NSSBER *ber | 850 NSSBER *ber |
| 855 ) | 851 ) |
| 856 { | 852 { |
| 857 return nssTrustDomain_FindCertificateByEncodedCertificate(td, ber); | 853 return nssTrustDomain_FindCertificateByEncodedCertificate(td, ber); |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1245 NSS_IMPLEMENT NSSCryptoContext * | 1241 NSS_IMPLEMENT NSSCryptoContext * |
| 1246 NSSTrustDomain_CreateCryptoContextForAlgorithmAndParameters ( | 1242 NSSTrustDomain_CreateCryptoContextForAlgorithmAndParameters ( |
| 1247 NSSTrustDomain *td, | 1243 NSSTrustDomain *td, |
| 1248 NSSAlgorithmAndParameters *ap | 1244 NSSAlgorithmAndParameters *ap |
| 1249 ) | 1245 ) |
| 1250 { | 1246 { |
| 1251 nss_SetError(NSS_ERROR_NOT_FOUND); | 1247 nss_SetError(NSS_ERROR_NOT_FOUND); |
| 1252 return NULL; | 1248 return NULL; |
| 1253 } | 1249 } |
| 1254 | 1250 |
| OLD | NEW |