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

Side by Side Diff: crypto/rsa_private_key_win.cc

Issue 8533028: RSAPrivateKey vector push_back cleanups. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « crypto/rsa_private_key_nss.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/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"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 215
216 scoped_array<BYTE> encoded(new BYTE[encoded_length]); 216 scoped_array<BYTE> encoded(new BYTE[encoded_length]);
217 if (!CryptEncodeObject( 217 if (!CryptEncodeObject(
218 X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, X509_PUBLIC_KEY_INFO, 218 X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, X509_PUBLIC_KEY_INFO,
219 reinterpret_cast<CERT_PUBLIC_KEY_INFO*>(key_info.get()), encoded.get(), 219 reinterpret_cast<CERT_PUBLIC_KEY_INFO*>(key_info.get()), encoded.get(),
220 &encoded_length)) { 220 &encoded_length)) {
221 NOTREACHED(); 221 NOTREACHED();
222 return false; 222 return false;
223 } 223 }
224 224
225 for (size_t i = 0; i < encoded_length; ++i) 225 output->assign(encoded.get(), encoded.get() + encoded_length);
226 output->push_back(encoded[i]);
227
228 return true; 226 return true;
229 } 227 }
230 228
231 } // namespace crypto 229 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/rsa_private_key_nss.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698