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

Side by Side Diff: net/base/keygen_handler_win.cc

Issue 112963005: Update uses of UTF conversions in courgette/, device/, extensions/, google_apis/, gpu/, ipc/, media… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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 | « net/base/escape_unittest.cc ('k') | net/base/mime_util.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 "net/base/keygen_handler.h" 5 #include "net/base/keygen_handler.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <wincrypt.h> 8 #include <wincrypt.h>
9 #pragma comment(lib, "crypt32.lib") 9 #pragma comment(lib, "crypt32.lib")
10 #include <rpc.h> 10 #include <rpc.h>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 return true; 57 return true;
58 } 58 }
59 59
60 // Generates a DER encoded SignedPublicKeyAndChallenge structure from the 60 // Generates a DER encoded SignedPublicKeyAndChallenge structure from the
61 // signing key of |prov| and the specified ASCII |challenge| string and 61 // signing key of |prov| and the specified ASCII |challenge| string and
62 // appends it to |output|. 62 // appends it to |output|.
63 // True if the encoding was successfully generated. 63 // True if the encoding was successfully generated.
64 bool GetSignedPublicKeyAndChallenge(HCRYPTPROV prov, 64 bool GetSignedPublicKeyAndChallenge(HCRYPTPROV prov,
65 const std::string& challenge, 65 const std::string& challenge,
66 std::string* output) { 66 std::string* output) {
67 std::wstring wide_challenge = ASCIIToWide(challenge); 67 std::wstring wide_challenge = base::ASCIIToWide(challenge);
68 std::vector<BYTE> spki; 68 std::vector<BYTE> spki;
69 69
70 if (!GetSubjectPublicKeyInfo(prov, &spki)) 70 if (!GetSubjectPublicKeyInfo(prov, &spki))
71 return false; 71 return false;
72 72
73 // PublicKeyAndChallenge ::= SEQUENCE { 73 // PublicKeyAndChallenge ::= SEQUENCE {
74 // spki SubjectPublicKeyInfo, 74 // spki SubjectPublicKeyInfo,
75 // challenge IA5STRING 75 // challenge IA5STRING
76 // } 76 // }
77 CERT_KEYGEN_REQUEST_INFO pkac; 77 CERT_KEYGEN_REQUEST_INFO pkac;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 212
213 std::string result; 213 std::string result;
214 base::Base64Encode(spkac, &result); 214 base::Base64Encode(spkac, &result);
215 215
216 VLOG(1) << "Keygen succeeded"; 216 VLOG(1) << "Keygen succeeded";
217 return result; 217 return result;
218 } 218 }
219 } 219 }
220 220
221 } // namespace net 221 } // namespace net
OLDNEW
« no previous file with comments | « net/base/escape_unittest.cc ('k') | net/base/mime_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698