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

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: Once again, this is *Manos*... the *Hands*... of *Fate* 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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 it != intermediate_ca_certs_.end(); ++it) { 465 it != intermediate_ca_certs_.end(); ++it) {
466 if (IsCertNameBlobInIssuerList(&(*it)->pCertInfo->Issuer, 466 if (IsCertNameBlobInIssuerList(&(*it)->pCertInfo->Issuer,
467 valid_issuers)) { 467 valid_issuers)) {
468 return true; 468 return true;
469 } 469 }
470 } 470 }
471 471
472 return false; 472 return false;
473 } 473 }
474 474
475 // static
476 bool X509Certificate::IsSelfSigned(OSCertHandle cert_handle) {
477 return !!CryptVerifyCertificateSignatureEx(
478 NULL,
479 X509_ASN_ENCODING,
480 CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT,
481 reinterpret_cast<void*>(const_cast<PCERT_CONTEXT>(cert_handle)),
482 CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT,
483 reinterpret_cast<void*>(const_cast<PCERT_CONTEXT>(cert_handle)),
484 0,
485 NULL);
486 }
487
475 } // namespace net 488 } // 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