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

Side by Side Diff: crypto/rsa_private_key_win.cc

Issue 6805019: Move crypto files out of base, to a top level directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 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
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 "base/crypto/rsa_private_key.h" 5 #include "crypto/rsa_private_key.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 12
13 namespace { 13 namespace {
14 // Helper for error handling during key import. 14 // Helper for error handling during key import.
15 #define READ_ASSERT(truth) \ 15 #define READ_ASSERT(truth) \
16 if (!(truth)) { \ 16 if (!(truth)) { \
17 NOTREACHED(); \ 17 NOTREACHED(); \
18 return false; \ 18 return false; \
19 } 19 }
20 } // namespace 20 } // namespace
21 21
22 namespace base { 22 namespace crypto {
23 23
24 // static 24 // static
25 RSAPrivateKey* RSAPrivateKey::Create(uint16 num_bits) { 25 RSAPrivateKey* RSAPrivateKey::Create(uint16 num_bits) {
26 scoped_ptr<RSAPrivateKey> result(new RSAPrivateKey); 26 scoped_ptr<RSAPrivateKey> result(new RSAPrivateKey);
27 if (!result->InitProvider()) 27 if (!result->InitProvider())
28 return NULL; 28 return NULL;
29 29
30 DWORD flags = CRYPT_EXPORTABLE; 30 DWORD flags = CRYPT_EXPORTABLE;
31 31
32 // The size is encoded as the upper 16 bits of the flags. :: sigh ::. 32 // The size is encoded as the upper 16 bits of the flags. :: sigh ::.
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 NOTREACHED(); 219 NOTREACHED();
220 return false; 220 return false;
221 } 221 }
222 222
223 for (size_t i = 0; i < encoded_length; ++i) 223 for (size_t i = 0; i < encoded_length; ++i)
224 output->push_back(encoded[i]); 224 output->push_back(encoded[i]);
225 225
226 return true; 226 return true;
227 } 227 }
228 228
229 } // namespace base 229 } // namespace crypto
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698