OLD | NEW |
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/quic/chromium/crypto/proof_source_chromium.h" | 5 #include "net/quic/chromium/crypto/proof_source_chromium.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "crypto/openssl_util.h" | 8 #include "crypto/openssl_util.h" |
9 #include "net/quic/core/crypto/crypto_protocol.h" | 9 #include "net/quic/core/crypto/crypto_protocol.h" |
10 #include "third_party/boringssl/src/include/openssl/digest.h" | 10 #include "third_party/boringssl/src/include/openssl/digest.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } | 74 } |
75 | 75 |
76 return true; | 76 return true; |
77 } | 77 } |
78 | 78 |
79 bool ProofSourceChromium::GetProofInner( | 79 bool ProofSourceChromium::GetProofInner( |
80 const QuicSocketAddress& server_addr, | 80 const QuicSocketAddress& server_addr, |
81 const string& hostname, | 81 const string& hostname, |
82 const string& server_config, | 82 const string& server_config, |
83 QuicVersion quic_version, | 83 QuicVersion quic_version, |
84 base::StringPiece chlo_hash, | 84 QuicStringPiece chlo_hash, |
85 const QuicTagVector& /* connection_options */, | 85 const QuicTagVector& /* connection_options */, |
86 QuicReferenceCountedPointer<ProofSource::Chain>* out_chain, | 86 QuicReferenceCountedPointer<ProofSource::Chain>* out_chain, |
87 QuicCryptoProof* proof) { | 87 QuicCryptoProof* proof) { |
88 DCHECK(proof != nullptr); | 88 DCHECK(proof != nullptr); |
89 DCHECK(private_key_.get()) << " this: " << this; | 89 DCHECK(private_key_.get()) << " this: " << this; |
90 | 90 |
91 crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE); | 91 crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE); |
92 bssl::ScopedEVP_MD_CTX sign_context; | 92 bssl::ScopedEVP_MD_CTX sign_context; |
93 EVP_PKEY_CTX* pkey_ctx; | 93 EVP_PKEY_CTX* pkey_ctx; |
94 | 94 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 VLOG(1) << "signature: " | 130 VLOG(1) << "signature: " |
131 << base::HexEncode(proof->signature.data(), proof->signature.size()); | 131 << base::HexEncode(proof->signature.data(), proof->signature.size()); |
132 proof->leaf_cert_scts = signed_certificate_timestamp_; | 132 proof->leaf_cert_scts = signed_certificate_timestamp_; |
133 return true; | 133 return true; |
134 } | 134 } |
135 | 135 |
136 void ProofSourceChromium::GetProof(const QuicSocketAddress& server_addr, | 136 void ProofSourceChromium::GetProof(const QuicSocketAddress& server_addr, |
137 const std::string& hostname, | 137 const std::string& hostname, |
138 const std::string& server_config, | 138 const std::string& server_config, |
139 QuicVersion quic_version, | 139 QuicVersion quic_version, |
140 base::StringPiece chlo_hash, | 140 QuicStringPiece chlo_hash, |
141 const QuicTagVector& connection_options, | 141 const QuicTagVector& connection_options, |
142 std::unique_ptr<Callback> callback) { | 142 std::unique_ptr<Callback> callback) { |
143 // As a transitional implementation, just call the synchronous version of | 143 // As a transitional implementation, just call the synchronous version of |
144 // GetProof, then invoke the callback with the results and destroy it. | 144 // GetProof, then invoke the callback with the results and destroy it. |
145 QuicReferenceCountedPointer<ProofSource::Chain> chain; | 145 QuicReferenceCountedPointer<ProofSource::Chain> chain; |
146 string signature; | 146 string signature; |
147 string leaf_cert_sct; | 147 string leaf_cert_sct; |
148 QuicCryptoProof out_proof; | 148 QuicCryptoProof out_proof; |
149 | 149 |
150 const bool ok = | 150 const bool ok = |
151 GetProofInner(server_addr, hostname, server_config, quic_version, | 151 GetProofInner(server_addr, hostname, server_config, quic_version, |
152 chlo_hash, connection_options, &chain, &out_proof); | 152 chlo_hash, connection_options, &chain, &out_proof); |
153 callback->Run(ok, chain, out_proof, nullptr /* details */); | 153 callback->Run(ok, chain, out_proof, nullptr /* details */); |
154 } | 154 } |
155 | 155 |
156 } // namespace net | 156 } // namespace net |
OLD | NEW |