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

Unified Diff: net/cert/sha256_legacy_support_nss_win.cc

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/cert_verify_proc_win.cc ('k') | net/cert/sha256_legacy_support_openssl_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/sha256_legacy_support_nss_win.cc
diff --git a/net/cert/sha256_legacy_support_win.cc b/net/cert/sha256_legacy_support_nss_win.cc
similarity index 63%
copy from net/cert/sha256_legacy_support_win.cc
copy to net/cert/sha256_legacy_support_nss_win.cc
index 656edd73ad419214a34881acb10d4020c93c07bb..5f44b05dd2a02031b845489877fae869ea25662c 100644
--- a/net/cert/sha256_legacy_support_win.cc
+++ b/net/cert/sha256_legacy_support_nss_win.cc
@@ -2,95 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "net/cert/sha256_legacy_support_win.h"
-
-#include <windows.h>
-#include <wincrypt.h>
-
#include <cert.h>
#include <keyhi.h>
#include <secoid.h>
-#include "base/lazy_instance.h"
#include "base/logging.h"
-#include "base/strings/string_piece.h"
-#include "base/win/windows_version.h"
#include "crypto/scoped_nss_types.h"
+#include "net/cert/sha256_legacy_support_win.h"
namespace net {
namespace sha256_interception {
-namespace {
-
-bool IsSupportedSubjectType(DWORD subject_type) {
- switch (subject_type) {
- case CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB:
- case CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT:
- case CRYPT_VERIFY_CERT_SIGN_SUBJECT_CRL:
- return true;
- }
- return false;
-}
-
-bool IsSupportedIssuerType(DWORD issuer_type) {
- switch (issuer_type) {
- case CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY:
- case CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT:
- case CRYPT_VERIFY_CERT_SIGN_ISSUER_CHAIN:
- return true;
- }
- return false;
-}
-
-base::StringPiece GetSubjectSignature(DWORD subject_type,
- void* subject_data) {
- switch (subject_type) {
- case CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB: {
- CRYPT_DATA_BLOB* data_blob =
- reinterpret_cast<CRYPT_DATA_BLOB*>(subject_data);
- return base::StringPiece(reinterpret_cast<char*>(data_blob->pbData),
- data_blob->cbData);
- }
- case CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT: {
- PCCERT_CONTEXT subject_cert =
- reinterpret_cast<PCCERT_CONTEXT>(subject_data);
- return base::StringPiece(
- reinterpret_cast<char*>(subject_cert->pbCertEncoded),
- subject_cert->cbCertEncoded);
- }
- case CRYPT_VERIFY_CERT_SIGN_SUBJECT_CRL: {
- PCCRL_CONTEXT subject_crl =
- reinterpret_cast<PCCRL_CONTEXT>(subject_data);
- return base::StringPiece(
- reinterpret_cast<char*>(subject_crl->pbCrlEncoded),
- subject_crl->cbCrlEncoded);
- }
- }
- return base::StringPiece();
-}
-
-PCERT_PUBLIC_KEY_INFO GetIssuerPublicKey(DWORD issuer_type,
- void* issuer_data) {
- switch (issuer_type) {
- case CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY:
- return reinterpret_cast<PCERT_PUBLIC_KEY_INFO>(issuer_data);
- case CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT: {
- PCCERT_CONTEXT cert = reinterpret_cast<PCCERT_CONTEXT>(issuer_data);
- return &cert->pCertInfo->SubjectPublicKeyInfo;
- }
- case CRYPT_VERIFY_CERT_SIGN_ISSUER_CHAIN: {
- PCCERT_CHAIN_CONTEXT chain =
- reinterpret_cast<PCCERT_CHAIN_CONTEXT>(issuer_data);
- PCCERT_CONTEXT cert = chain->rgpChain[0]->rgpElement[0]->pCertContext;
- return &cert->pCertInfo->SubjectPublicKeyInfo;
- }
- }
- return NULL;
-}
-
-} // namespace
-
BOOL CryptVerifyCertificateSignatureExHook(
CryptVerifyCertificateSignatureExFunc original_func,
HCRYPTPROV_LEGACY provider,
« no previous file with comments | « net/cert/cert_verify_proc_win.cc ('k') | net/cert/sha256_legacy_support_openssl_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698