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/crypto/proof_source_chromium.h" | 5 #include "net/quic/crypto/proof_source_chromium.h" |
6 | 6 |
7 #include <openssl/digest.h> | 7 #include <openssl/digest.h> |
8 #include <openssl/evp.h> | 8 #include <openssl/evp.h> |
9 #include <openssl/rsa.h> | 9 #include <openssl/rsa.h> |
10 | 10 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 signature.resize(len); | 144 signature.resize(len); |
145 out_signature->assign(reinterpret_cast<const char*>(signature.data()), | 145 out_signature->assign(reinterpret_cast<const char*>(signature.data()), |
146 signature.size()); | 146 signature.size()); |
147 *out_chain = chain_; | 147 *out_chain = chain_; |
148 VLOG(1) << "signature: " | 148 VLOG(1) << "signature: " |
149 << base::HexEncode(out_signature->data(), out_signature->size()); | 149 << base::HexEncode(out_signature->data(), out_signature->size()); |
150 *out_leaf_cert_sct = signed_certificate_timestamp_; | 150 *out_leaf_cert_sct = signed_certificate_timestamp_; |
151 return true; | 151 return true; |
152 } | 152 } |
153 | 153 |
154 void ProofSourceChromium::GetProof(const IPAddress& server_ip, | |
155 const std::string& hostname, | |
156 const std::string& server_config, | |
157 QuicVersion quic_version, | |
158 base::StringPiece chlo_hash, | |
159 bool ecdsa_ok, | |
160 std::unique_ptr<Callback> callback) { | |
161 // As a transitional implementation, just call the synchronous version of | |
162 // GetProof, then invoke the callback with the results and destroy it. | |
163 // TODO(gredner): rework this when GetProof involves an RPC. At that point | |
164 // this class will also need to store a pointer to the callback and ensure | |
165 // that it gets deleted after it is invoked. | |
Ryan Hamilton
2016/07/07 16:34:00
Since proof_source_chromium is not shared, I think
| |
166 scoped_refptr<ProofSource::Chain> chain; | |
167 string signature; | |
168 string leaf_cert_sct; | |
169 const bool ok = | |
170 GetProof(server_ip, hostname, server_config, quic_version, chlo_hash, | |
171 ecdsa_ok, &chain, &signature, &leaf_cert_sct); | |
172 callback->Run(ok, chain, signature, leaf_cert_sct); | |
173 } | |
174 | |
154 } // namespace net | 175 } // namespace net |
OLD | NEW |