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

Side by Side Diff: crypto/symmetric_key_openssl.cc

Issue 16123026: Use a direct include of strings headers in crypto/, dbus/, device/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « crypto/rsa_private_key_win.cc ('k') | crypto/symmetric_key_unittest.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/symmetric_key.h" 5 #include "crypto/symmetric_key.h"
6 6
7 #include <openssl/evp.h> 7 #include <openssl/evp.h>
8 #include <openssl/rand.h> 8 #include <openssl/rand.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
11 11
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/string_util.h" 14 #include "base/strings/string_util.h"
15 #include "crypto/openssl_util.h" 15 #include "crypto/openssl_util.h"
16 16
17 namespace crypto { 17 namespace crypto {
18 18
19 SymmetricKey::~SymmetricKey() { 19 SymmetricKey::~SymmetricKey() {
20 std::fill(key_.begin(), key_.end(), '\0'); // Zero out the confidential key. 20 std::fill(key_.begin(), key_.end(), '\0'); // Zero out the confidential key.
21 } 21 }
22 22
23 // static 23 // static
24 SymmetricKey* SymmetricKey::GenerateRandomKey(Algorithm algorithm, 24 SymmetricKey* SymmetricKey::GenerateRandomKey(Algorithm algorithm,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 key->key_ = raw_key; 71 key->key_ = raw_key;
72 return key.release(); 72 return key.release();
73 } 73 }
74 74
75 bool SymmetricKey::GetRawKey(std::string* raw_key) { 75 bool SymmetricKey::GetRawKey(std::string* raw_key) {
76 *raw_key = key_; 76 *raw_key = key_;
77 return true; 77 return true;
78 } 78 }
79 79
80 } // namespace crypto 80 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/rsa_private_key_win.cc ('k') | crypto/symmetric_key_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698