OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/base/x509_util.h" | 5 #include "net/base/x509_util.h" |
6 #include "net/base/x509_util_nss.h" | 6 #include "net/base/x509_util_nss.h" |
7 | 7 |
8 #include <cert.h> | 8 #include <cert.h> |
9 #include <cryptohi.h> | 9 #include <cryptohi.h> |
10 #include <nss.h> | 10 #include <nss.h> |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
520 break; | 520 break; |
521 case ecKey: | 521 case ecKey: |
522 *type = X509Certificate::kPublicKeyTypeECDSA; | 522 *type = X509Certificate::kPublicKeyTypeECDSA; |
523 break; | 523 break; |
524 default: | 524 default: |
525 *type = X509Certificate::kPublicKeyTypeUnknown; | 525 *type = X509Certificate::kPublicKeyTypeUnknown; |
526 *size_bits = 0; | 526 *size_bits = 0; |
527 break; | 527 break; |
528 } | 528 } |
529 } | 529 } |
530 | |
531 bool IsCertNameItemInIssuerList( | |
532 SECItem* name, | |
533 const std::vector<std::string>& valid_issuers) { | |
534 for (std::vector<std::string>::const_iterator it = valid_issuers.begin(); | |
535 it != valid_issuers.end(); ++it) { | |
536 SECItem issuer; | |
537 issuer.type = siDERNameBuffer; | |
538 issuer.data = reinterpret_cast<unsigned char*>( | |
539 const_cast<char*>(it->data())); | |
540 issuer.len = static_cast<unsigned int>(it->length()); | |
541 if (SECITEM_ItemsAreEqual(&issuer, name)) | |
Ryan Sleevi
2012/12/13 19:49:05
use the CERTName comparison
digit1
2012/12/14 17:54:33
That's not do-able for the reason explained previo
Ryan Sleevi
2012/12/14 18:16:42
See comments about the NSS API to use to do this :
| |
542 return true; | |
543 } | |
544 return false; | |
545 } | |
546 | |
530 #endif // defined(USE_NSS) || defined(OS_IOS) | 547 #endif // defined(USE_NSS) || defined(OS_IOS) |
531 | 548 |
532 } // namespace x509_util | 549 } // namespace x509_util |
533 | 550 |
534 } // namespace net | 551 } // namespace net |
OLD | NEW |