OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/spdy/spdy_test_util_common.h" | 5 #include "net/spdy/spdy_test_util_common.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } | 285 } |
286 | 286 |
287 MockECSignatureCreator::MockECSignatureCreator(crypto::ECPrivateKey* key) | 287 MockECSignatureCreator::MockECSignatureCreator(crypto::ECPrivateKey* key) |
288 : key_(key) { | 288 : key_(key) { |
289 } | 289 } |
290 | 290 |
291 bool MockECSignatureCreator::Sign(const uint8_t* data, | 291 bool MockECSignatureCreator::Sign(const uint8_t* data, |
292 int data_len, | 292 int data_len, |
293 std::vector<uint8_t>* signature) { | 293 std::vector<uint8_t>* signature) { |
294 std::vector<uint8_t> private_key_value; | 294 std::vector<uint8_t> private_key_value; |
295 key_->ExportValue(&private_key_value); | 295 if (!key_->ExportValueForTesting(&private_key_value)) |
| 296 return false; |
296 std::string head = "fakesignature"; | 297 std::string head = "fakesignature"; |
297 std::string tail = "/fakesignature"; | 298 std::string tail = "/fakesignature"; |
298 | 299 |
299 signature->clear(); | 300 signature->clear(); |
300 signature->insert(signature->end(), head.begin(), head.end()); | 301 signature->insert(signature->end(), head.begin(), head.end()); |
301 signature->insert(signature->end(), private_key_value.begin(), | 302 signature->insert(signature->end(), private_key_value.begin(), |
302 private_key_value.end()); | 303 private_key_value.end()); |
303 signature->insert(signature->end(), '-'); | 304 signature->insert(signature->end(), '-'); |
304 signature->insert(signature->end(), data, data + data_len); | 305 signature->insert(signature->end(), data, data + data_len); |
305 signature->insert(signature->end(), tail.begin(), tail.end()); | 306 signature->insert(signature->end(), tail.begin(), tail.end()); |
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1268 } | 1269 } |
1269 } | 1270 } |
1270 | 1271 |
1271 void SpdyTestUtil::SetPriority(RequestPriority priority, | 1272 void SpdyTestUtil::SetPriority(RequestPriority priority, |
1272 SpdySynStreamIR* ir) const { | 1273 SpdySynStreamIR* ir) const { |
1273 ir->set_priority(ConvertRequestPriorityToSpdyPriority( | 1274 ir->set_priority(ConvertRequestPriorityToSpdyPriority( |
1274 priority, spdy_version())); | 1275 priority, spdy_version())); |
1275 } | 1276 } |
1276 | 1277 |
1277 } // namespace net | 1278 } // namespace net |
OLD | NEW |