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

Side by Side Diff: crypto/ec_private_key.cc

Issue 2677583002: Fix non-noise cpplint errors in //crypto. (Closed)
Patch Set: fix p224_unittest.cc Created 3 years, 10 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/apple_keychain.h ('k') | crypto/ec_signature_creator_impl.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "crypto/ec_private_key.h" 5 #include "crypto/ec_private_key.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 28 matching lines...) Expand all
39 if (!key) 39 if (!key)
40 return false; 40 return false;
41 41
42 bssl::UniquePtr<BIO> bio(BIO_new(BIO_s_mem())); 42 bssl::UniquePtr<BIO> bio(BIO_new(BIO_s_mem()));
43 if (!bio) 43 if (!bio)
44 return false; 44 return false;
45 45
46 if (!export_fn(bio.get(), key)) 46 if (!export_fn(bio.get(), key))
47 return false; 47 return false;
48 48
49 char* data = nullptr; 49 const uint8_t* data;
50 long len = BIO_get_mem_data(bio.get(), &data); 50 size_t len;
51 if (!data || len < 0) 51 if (!BIO_mem_contents(bio.get(), &data, &len))
52 return false; 52 return false;
53 53
54 output->assign(data, data + len); 54 output->assign(data, data + len);
55 return true; 55 return true;
56 } 56 }
57 57
58 } // namespace 58 } // namespace
59 59
60 ECPrivateKey::~ECPrivateKey() {} 60 ECPrivateKey::~ECPrivateKey() {}
61 61
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 return false; 215 return false;
216 } 216 }
217 217
218 output->assign(reinterpret_cast<const char*>(buf), sizeof(buf)); 218 output->assign(reinterpret_cast<const char*>(buf), sizeof(buf));
219 return true; 219 return true;
220 } 220 }
221 221
222 ECPrivateKey::ECPrivateKey() {} 222 ECPrivateKey::ECPrivateKey() {}
223 223
224 } // namespace crypto 224 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/apple_keychain.h ('k') | crypto/ec_signature_creator_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698