Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1783)

Side by Side Diff: net/base/x509_util_nss.cc

Issue 11579002: Add X509Certificate::IsIssuedByEncoded() (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add missing base files (damn you git cl upload) Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« net/base/x509_util_nss.h ('K') | « net/base/x509_util_nss.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« net/base/x509_util_nss.h ('K') | « net/base/x509_util_nss.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698