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

Side by Side Diff: net/cert/ct_log_verifier_nss.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.cc ('k') | net/cert/ct_log_verifier_openssl.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 <cryptohi.h> 7 #include <cryptohi.h>
8 #include <keyhi.h> 8 #include <keyhi.h>
9 #include <nss.h> 9 #include <nss.h>
10 #include <pk11pub.h> 10 #include <pk11pub.h>
11 #include <secitem.h> 11 #include <secitem.h>
12 #include <secoid.h> 12 #include <secoid.h>
13 13
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "crypto/nss_util.h" 15 #include "crypto/nss_util.h"
16 #include "crypto/sha2.h" 16 #include "crypto/sha2.h"
17 #include "net/cert/signed_certificate_timestamp.h" 17 #include "net/cert/signed_tree_head.h"
18 18
19 namespace net { 19 namespace net {
20 20
21 namespace { 21 namespace {
22 22
23 SECOidTag GetNSSSigAlg(ct::DigitallySigned::SignatureAlgorithm alg) { 23 SECOidTag GetNSSSigAlg(ct::DigitallySigned::SignatureAlgorithm alg) {
24 switch (alg) { 24 switch (alg) {
25 case ct::DigitallySigned::SIG_ALGO_RSA: 25 case ct::DigitallySigned::SIG_ALGO_RSA:
26 return SEC_OID_PKCS1_RSA_ENCRYPTION; 26 return SEC_OID_PKCS1_RSA_ENCRYPTION;
27 case ct::DigitallySigned::SIG_ALGO_DSA: 27 case ct::DigitallySigned::SIG_ALGO_DSA:
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 SECStatus rv = VFY_VerifyDataDirect( 133 SECStatus rv = VFY_VerifyDataDirect(
134 reinterpret_cast<const unsigned char*>(data_to_sign.data()), 134 reinterpret_cast<const unsigned char*>(data_to_sign.data()),
135 data_to_sign.size(), public_key_, &sig_data, 135 data_to_sign.size(), public_key_, &sig_data,
136 GetNSSSigAlg(signature_algorithm_), GetNSSHashAlg(hash_algorithm_), 136 GetNSSSigAlg(signature_algorithm_), GetNSSHashAlg(hash_algorithm_),
137 NULL, NULL); 137 NULL, NULL);
138 DVLOG(1) << "Signature verification result: " << (rv == SECSuccess); 138 DVLOG(1) << "Signature verification result: " << (rv == SECSuccess);
139 return rv == SECSuccess; 139 return rv == SECSuccess;
140 } 140 }
141 141
142 } // namespace net 142 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/ct_log_verifier.cc ('k') | net/cert/ct_log_verifier_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698