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 * pkix_pl_ldapcertstore.c | 5 * pkix_pl_ldapcertstore.c |
6 * | 6 * |
7 * LDAPCertStore Function Definitions | 7 * LDAPCertStore Function Definitions |
8 * | 8 * |
9 */ | 9 */ |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 */ | 43 */ |
44 PKIX_Error * | 44 PKIX_Error * |
45 pkix_pl_LdapCertStore_DecodeCrossCertPair( | 45 pkix_pl_LdapCertStore_DecodeCrossCertPair( |
46 SECItem *derCCPItem, | 46 SECItem *derCCPItem, |
47 PKIX_List *certList, | 47 PKIX_List *certList, |
48 void *plContext) | 48 void *plContext) |
49 { | 49 { |
50 LDAPCertPair certPair = {{ siBuffer, NULL, 0 }, { siBuffer, NULL, 0 }}; | 50 LDAPCertPair certPair = {{ siBuffer, NULL, 0 }, { siBuffer, NULL, 0 }}; |
51 SECStatus rv = SECFailure; | 51 SECStatus rv = SECFailure; |
52 | 52 |
53 PRArenaPool *tempArena = NULL; | 53 PLArenaPool *tempArena = NULL; |
54 | 54 |
55 PKIX_ENTER(CERTSTORE, "pkix_pl_LdapCertStore_DecodeCrossCertPair"); | 55 PKIX_ENTER(CERTSTORE, "pkix_pl_LdapCertStore_DecodeCrossCertPair"); |
56 PKIX_NULLCHECK_TWO(derCCPItem, certList); | 56 PKIX_NULLCHECK_TWO(derCCPItem, certList); |
57 | 57 |
58 tempArena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); | 58 tempArena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); |
59 if (!tempArena) { | 59 if (!tempArena) { |
60 PKIX_ERROR(PKIX_OUTOFMEMORY); | 60 PKIX_ERROR(PKIX_OUTOFMEMORY); |
61 } | 61 } |
62 | 62 |
63 rv = SEC_ASN1DecodeItem(tempArena, &certPair, PKIX_PL_LDAPCrossCertPairT
emplate, | 63 rv = SEC_ASN1DecodeItem(tempArena, &certPair, PKIX_PL_LDAPCrossCertPairT
emplate, |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 * | 401 * |
402 * "name" is checked for commonName and organizationName components (cn=, | 402 * "name" is checked for commonName and organizationName components (cn=, |
403 * and o=). The component strings are extracted using the family of | 403 * and o=). The component strings are extracted using the family of |
404 * CERT_Get* functions, and each must be freed with PORT_Free. | 404 * CERT_Get* functions, and each must be freed with PORT_Free. |
405 * | 405 * |
406 * It is not clear which components should be in a request, so, for now, | 406 * It is not clear which components should be in a request, so, for now, |
407 * we stop adding components after we have found one. | 407 * we stop adding components after we have found one. |
408 * | 408 * |
409 * PARAMETERS: | 409 * PARAMETERS: |
410 * "arena" | 410 * "arena" |
411 * The address of the PRArenaPool used in creating the filter. Must be | 411 * The address of the PLArenaPool used in creating the filter. Must be |
412 * non-NULL. | 412 * non-NULL. |
413 * "name" | 413 * "name" |
414 * The address of the X500Name whose components define the desired | 414 * The address of the X500Name whose components define the desired |
415 * matches. Must be non-NULL. | 415 * matches. Must be non-NULL. |
416 * "pList" | 416 * "pList" |
417 * The address at which the result is stored. | 417 * The address at which the result is stored. |
418 * "plContext" | 418 * "plContext" |
419 * Platform-specific context pointer | 419 * Platform-specific context pointer |
420 * THREAD SAFETY: | 420 * THREAD SAFETY: |
421 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) | 421 * Thread Safe (see Thread Safety Definitions in Programmer's Guide) |
422 * RETURNS: | 422 * RETURNS: |
423 * Returns NULL if the function succeeds. | 423 * Returns NULL if the function succeeds. |
424 * Returns a CertStore Error if the function fails in a non-fatal way. | 424 * Returns a CertStore Error if the function fails in a non-fatal way. |
425 * Returns a Fatal Error if the function fails in an unrecoverable way. | 425 * Returns a Fatal Error if the function fails in an unrecoverable way. |
426 */ | 426 */ |
427 static PKIX_Error * | 427 static PKIX_Error * |
428 pkix_pl_LdapCertStore_MakeNameAVAList( | 428 pkix_pl_LdapCertStore_MakeNameAVAList( |
429 PRArenaPool *arena, | 429 PLArenaPool *arena, |
430 PKIX_PL_X500Name *subjectName, | 430 PKIX_PL_X500Name *subjectName, |
431 LDAPNameComponent ***pList, | 431 LDAPNameComponent ***pList, |
432 void *plContext) | 432 void *plContext) |
433 { | 433 { |
434 LDAPNameComponent **setOfNameComponents; | 434 LDAPNameComponent **setOfNameComponents; |
435 LDAPNameComponent *currentNameComponent = NULL; | 435 LDAPNameComponent *currentNameComponent = NULL; |
436 PKIX_UInt32 componentsPresent = 0; | 436 PKIX_UInt32 componentsPresent = 0; |
437 void *v = NULL; | 437 void *v = NULL; |
438 unsigned char *component = NULL; | 438 unsigned char *component = NULL; |
439 | 439 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 */ | 563 */ |
564 PKIX_Error * | 564 PKIX_Error * |
565 pkix_pl_LdapCertStore_GetCert( | 565 pkix_pl_LdapCertStore_GetCert( |
566 PKIX_CertStore *store, | 566 PKIX_CertStore *store, |
567 PKIX_CertSelector *selector, | 567 PKIX_CertSelector *selector, |
568 PKIX_VerifyNode *verifyNode, | 568 PKIX_VerifyNode *verifyNode, |
569 void **pNBIOContext, | 569 void **pNBIOContext, |
570 PKIX_List **pCertList, | 570 PKIX_List **pCertList, |
571 void *plContext) | 571 void *plContext) |
572 { | 572 { |
573 PRArenaPool *requestArena = NULL; | 573 PLArenaPool *requestArena = NULL; |
574 LDAPRequestParams requestParams; | 574 LDAPRequestParams requestParams; |
575 void *pollDesc = NULL; | 575 void *pollDesc = NULL; |
576 PKIX_Int32 minPathLen = 0; | 576 PKIX_Int32 minPathLen = 0; |
577 PKIX_Boolean cacheFlag = PKIX_FALSE; | 577 PKIX_Boolean cacheFlag = PKIX_FALSE; |
578 PKIX_ComCertSelParams *params = NULL; | 578 PKIX_ComCertSelParams *params = NULL; |
579 PKIX_PL_LdapCertStoreContext *lcs = NULL; | 579 PKIX_PL_LdapCertStoreContext *lcs = NULL; |
580 PKIX_List *responses = NULL; | 580 PKIX_List *responses = NULL; |
581 PKIX_List *unfilteredCerts = NULL; | 581 PKIX_List *unfilteredCerts = NULL; |
582 PKIX_List *filteredCerts = NULL; | 582 PKIX_List *filteredCerts = NULL; |
583 PKIX_PL_X500Name *subjectName = 0; | 583 PKIX_PL_X500Name *subjectName = 0; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 PKIX_Error * | 799 PKIX_Error * |
800 pkix_pl_LdapCertStore_GetCRL( | 800 pkix_pl_LdapCertStore_GetCRL( |
801 PKIX_CertStore *store, | 801 PKIX_CertStore *store, |
802 PKIX_CRLSelector *selector, | 802 PKIX_CRLSelector *selector, |
803 void **pNBIOContext, | 803 void **pNBIOContext, |
804 PKIX_List **pCrlList, | 804 PKIX_List **pCrlList, |
805 void *plContext) | 805 void *plContext) |
806 { | 806 { |
807 LDAPRequestParams requestParams; | 807 LDAPRequestParams requestParams; |
808 void *pollDesc = NULL; | 808 void *pollDesc = NULL; |
809 PRArenaPool *requestArena = NULL; | 809 PLArenaPool *requestArena = NULL; |
810 PKIX_UInt32 numNames = 0; | 810 PKIX_UInt32 numNames = 0; |
811 PKIX_UInt32 thisName = 0; | 811 PKIX_UInt32 thisName = 0; |
812 PKIX_PL_CRL *candidate = NULL; | 812 PKIX_PL_CRL *candidate = NULL; |
813 PKIX_List *responses = NULL; | 813 PKIX_List *responses = NULL; |
814 PKIX_List *issuerNames = NULL; | 814 PKIX_List *issuerNames = NULL; |
815 PKIX_List *filteredCRLs = NULL; | 815 PKIX_List *filteredCRLs = NULL; |
816 PKIX_List *unfilteredCRLs = NULL; | 816 PKIX_List *unfilteredCRLs = NULL; |
817 PKIX_PL_X500Name *issuer = NULL; | 817 PKIX_PL_X500Name *issuer = NULL; |
818 PKIX_PL_LdapCertStoreContext *lcs = NULL; | 818 PKIX_PL_LdapCertStoreContext *lcs = NULL; |
819 PKIX_ComCRLSelParams *params = NULL; | 819 PKIX_ComCRLSelParams *params = NULL; |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 &certStore, | 1107 &certStore, |
1108 plContext), | 1108 plContext), |
1109 PKIX_CERTSTORECREATEFAILED); | 1109 PKIX_CERTSTORECREATEFAILED); |
1110 | 1110 |
1111 *pCertStore = certStore; | 1111 *pCertStore = certStore; |
1112 | 1112 |
1113 cleanup: | 1113 cleanup: |
1114 | 1114 |
1115 PKIX_RETURN(CERTSTORE); | 1115 PKIX_RETURN(CERTSTORE); |
1116 } | 1116 } |
OLD | NEW |