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 #include "nspr.h" | 4 #include "nspr.h" |
5 #include "secerr.h" | 5 #include "secerr.h" |
6 #include "secasn1.h" | 6 #include "secasn1.h" |
7 #include "seccomon.h" | 7 #include "seccomon.h" |
8 #include "pk11func.h" | 8 #include "pk11func.h" |
9 #include "certdb.h" | 9 #include "certdb.h" |
10 #include "certt.h" | 10 #include "certt.h" |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 PORT_FreeArena(names->arena, PR_FALSE); | 535 PORT_FreeArena(names->arena, PR_FALSE); |
536 | 536 |
537 return; | 537 return; |
538 } | 538 } |
539 | 539 |
540 static SECStatus | 540 static SECStatus |
541 CollectDistNames( CERTCertificate *cert, SECItem *k, void *data) | 541 CollectDistNames( CERTCertificate *cert, SECItem *k, void *data) |
542 { | 542 { |
543 CERTDistNames *names; | 543 CERTDistNames *names; |
544 PRBool saveit = PR_FALSE; | 544 PRBool saveit = PR_FALSE; |
545 CERTCertTrust *trust; | 545 CERTCertTrust trust; |
546 dnameNode *node; | 546 dnameNode *node; |
547 int len; | 547 int len; |
548 | 548 |
549 names = (CERTDistNames *)data; | 549 names = (CERTDistNames *)data; |
550 | 550 |
551 if ( cert->trust ) { | 551 if ( CERT_GetCertTrust(cert, &trust) == SECSuccess ) { |
552 » trust = cert->trust; | |
553 » | |
554 /* only collect names of CAs trusted for issuing SSL clients */ | 552 /* only collect names of CAs trusted for issuing SSL clients */ |
555 » if ( trust->sslFlags & CERTDB_TRUSTED_CLIENT_CA ) { | 553 » if ( trust.sslFlags & CERTDB_TRUSTED_CLIENT_CA ) { |
556 saveit = PR_TRUE; | 554 saveit = PR_TRUE; |
557 } | 555 } |
558 } | 556 } |
559 | 557 |
560 if ( saveit ) { | 558 if ( saveit ) { |
561 /* allocate the node */ | 559 /* allocate the node */ |
562 node = (dnameNode*)PORT_ArenaAlloc(names->arena, sizeof(dnameNode)); | 560 node = (dnameNode*)PORT_ArenaAlloc(names->arena, sizeof(dnameNode)); |
563 if ( node == NULL ) { | 561 if ( node == NULL ) { |
564 return(SECFailure); | 562 return(SECFailure); |
565 } | 563 } |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 } | 1184 } |
1187 return NULL; | 1185 return NULL; |
1188 } | 1186 } |
1189 | 1187 |
1190 void | 1188 void |
1191 CERT_DestroyCertificateList(CERTCertificateList *list) | 1189 CERT_DestroyCertificateList(CERTCertificateList *list) |
1192 { | 1190 { |
1193 PORT_FreeArena(list->arena, PR_FALSE); | 1191 PORT_FreeArena(list->arena, PR_FALSE); |
1194 } | 1192 } |
1195 | 1193 |
OLD | NEW |