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

Side by Side Diff: crypto/symmetric_key_openssl.cc

Issue 1312203002: Include BoringSSL headers from third_party/ in crypto. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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/signature_verifier_openssl.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) 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>
8 #include <openssl/rand.h>
9
10 #include <algorithm> 7 #include <algorithm>
11 8
12 #include "base/logging.h" 9 #include "base/logging.h"
13 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
14 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
15 #include "crypto/openssl_util.h" 12 #include "crypto/openssl_util.h"
13 #include "third_party/boringssl/src/include/openssl/evp.h"
14 #include "third_party/boringssl/src/include/openssl/rand.h"
16 15
17 namespace crypto { 16 namespace crypto {
18 17
19 SymmetricKey::~SymmetricKey() { 18 SymmetricKey::~SymmetricKey() {
20 std::fill(key_.begin(), key_.end(), '\0'); // Zero out the confidential key. 19 std::fill(key_.begin(), key_.end(), '\0'); // Zero out the confidential key.
21 } 20 }
22 21
23 // static 22 // static
24 SymmetricKey* SymmetricKey::GenerateRandomKey(Algorithm algorithm, 23 SymmetricKey* SymmetricKey::GenerateRandomKey(Algorithm algorithm,
25 size_t key_size_in_bits) { 24 size_t key_size_in_bits) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 key->key_ = raw_key; 94 key->key_ = raw_key;
96 return key.release(); 95 return key.release();
97 } 96 }
98 97
99 bool SymmetricKey::GetRawKey(std::string* raw_key) { 98 bool SymmetricKey::GetRawKey(std::string* raw_key) {
100 *raw_key = key_; 99 *raw_key = key_;
101 return true; 100 return true;
102 } 101 }
103 102
104 } // namespace crypto 103 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/signature_verifier_openssl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698