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

Side by Side Diff: net/spdy/spdy_test_util_common.cc

Issue 1935053003: Add PKCS#8 ECPrivateKey export/import functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build Created 4 years, 6 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 | « crypto/rsa_private_key.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 8
9 #include <cstddef> 9 #include <cstddef>
10 #include <memory> 10 #include <memory>
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 SetResult(result); 288 SetResult(result);
289 } 289 }
290 290
291 MockECSignatureCreator::MockECSignatureCreator(crypto::ECPrivateKey* key) 291 MockECSignatureCreator::MockECSignatureCreator(crypto::ECPrivateKey* key)
292 : key_(key) { 292 : key_(key) {
293 } 293 }
294 294
295 bool MockECSignatureCreator::Sign(const uint8_t* data, 295 bool MockECSignatureCreator::Sign(const uint8_t* data,
296 int data_len, 296 int data_len,
297 std::vector<uint8_t>* signature) { 297 std::vector<uint8_t>* signature) {
298 std::vector<uint8_t> private_key_value; 298 std::vector<uint8_t> private_key;
299 if (!key_->ExportValueForTesting(&private_key_value)) 299 if (!key_->ExportPrivateKey(&private_key))
300 return false; 300 return false;
301 std::string head = "fakesignature"; 301 std::string head = "fakesignature";
302 std::string tail = "/fakesignature"; 302 std::string tail = "/fakesignature";
303 303
304 signature->clear(); 304 signature->clear();
305 signature->insert(signature->end(), head.begin(), head.end()); 305 signature->insert(signature->end(), head.begin(), head.end());
306 signature->insert(signature->end(), private_key_value.begin(), 306 signature->insert(signature->end(), private_key.begin(), private_key.end());
307 private_key_value.end());
308 signature->insert(signature->end(), '-'); 307 signature->insert(signature->end(), '-');
309 signature->insert(signature->end(), data, data + data_len); 308 signature->insert(signature->end(), data, data + data_len);
310 signature->insert(signature->end(), tail.begin(), tail.end()); 309 signature->insert(signature->end(), tail.begin(), tail.end());
311 return true; 310 return true;
312 } 311 }
313 312
314 bool MockECSignatureCreator::DecodeSignature( 313 bool MockECSignatureCreator::DecodeSignature(
315 const std::vector<uint8_t>& signature, 314 const std::vector<uint8_t>& signature,
316 std::vector<uint8_t>* out_raw_sig) { 315 std::vector<uint8_t>* out_raw_sig) {
317 *out_raw_sig = signature; 316 *out_raw_sig = signature;
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 } 1318 }
1320 } 1319 }
1321 1320
1322 void SpdyTestUtil::SetPriority(RequestPriority priority, 1321 void SpdyTestUtil::SetPriority(RequestPriority priority,
1323 SpdySynStreamIR* ir) const { 1322 SpdySynStreamIR* ir) const {
1324 ir->set_priority(ConvertRequestPriorityToSpdyPriority( 1323 ir->set_priority(ConvertRequestPriorityToSpdyPriority(
1325 priority, spdy_version())); 1324 priority, spdy_version()));
1326 } 1325 }
1327 1326
1328 } // namespace net 1327 } // namespace net
OLDNEW
« no previous file with comments | « crypto/rsa_private_key.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698