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

Side by Side Diff: net/cert/x509_certificate_win.cc

Issue 634033002: Check whether or not a certificate is self-signed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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
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/cert/x509_certificate.h" 5 #include "net/cert/x509_certificate.h"
6 6
7 #include <blapi.h> // Implement CalculateChainFingerprint() with NSS. 7 #include <blapi.h> // Implement CalculateChainFingerprint() with NSS.
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 it != intermediate_ca_certs_.end(); ++it) { 446 it != intermediate_ca_certs_.end(); ++it) {
447 if (IsCertNameBlobInIssuerList(&(*it)->pCertInfo->Issuer, 447 if (IsCertNameBlobInIssuerList(&(*it)->pCertInfo->Issuer,
448 valid_issuers)) { 448 valid_issuers)) {
449 return true; 449 return true;
450 } 450 }
451 } 451 }
452 452
453 return false; 453 return false;
454 } 454 }
455 455
456 // static
457 bool X509Certificate::IsSelfSigned(OSCertHandle cert_handle) {
458 return CryptVerifyCertificateSignatureEx(
459 NULL,
460 X509_ASN_ENCODING,
461 CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT,
462 cert_handle,
463 CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT,
464 cert_handle,
465 0,
466 NULL);
467 }
468
456 } // namespace net 469 } // namespace net
OLDNEW
« net/cert/x509_certificate_openssl.cc ('K') | « net/cert/x509_certificate_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698