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

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

Issue 230713002: Certificate Transparency: Parse Signed Tree Heads and validate them (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing more of Ryan's comments Created 6 years, 7 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
« no previous file with comments | « net/cert/ct_log_verifier_nss.cc ('k') | net/cert/ct_log_verifier_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ct_log_verifier.h" 5 #include "net/cert/ct_log_verifier.h"
6 6
7 #include <openssl/evp.h> 7 #include <openssl/evp.h>
8 #include <openssl/x509.h> 8 #include <openssl/x509.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "crypto/openssl_util.h" 11 #include "crypto/openssl_util.h"
12 #include "crypto/sha2.h" 12 #include "crypto/sha2.h"
13 #include "net/cert/signed_tree_head.h"
13 14
14 namespace net { 15 namespace net {
15 16
16 namespace { 17 namespace {
17 18
18 const EVP_MD* GetEvpAlg(ct::DigitallySigned::HashAlgorithm alg) { 19 const EVP_MD* GetEvpAlg(ct::DigitallySigned::HashAlgorithm alg) {
19 switch (alg) { 20 switch (alg) {
20 case ct::DigitallySigned::HASH_ALGO_MD5: 21 case ct::DigitallySigned::HASH_ALGO_MD5:
21 return EVP_md5(); 22 return EVP_md5();
22 case ct::DigitallySigned::HASH_ALGO_SHA1: 23 case ct::DigitallySigned::HASH_ALGO_SHA1:
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 1 == EVP_DigestVerifyFinal( 112 1 == EVP_DigestVerifyFinal(
112 &ctx, 113 &ctx,
113 reinterpret_cast<unsigned char*>(const_cast<char*>(signature.data())), 114 reinterpret_cast<unsigned char*>(const_cast<char*>(signature.data())),
114 signature.size())); 115 signature.size()));
115 116
116 EVP_MD_CTX_cleanup(&ctx); 117 EVP_MD_CTX_cleanup(&ctx);
117 return ok; 118 return ok;
118 } 119 }
119 120
120 } // namespace net 121 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/ct_log_verifier_nss.cc ('k') | net/cert/ct_log_verifier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698