OLD | NEW |
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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 204 |
205 std::string spkac; | 205 std::string spkac; |
206 if (!GetSignedPublicKeyAndChallenge(key_container.provider_, challenge_, | 206 if (!GetSignedPublicKeyAndChallenge(key_container.provider_, challenge_, |
207 &spkac)) { | 207 &spkac)) { |
208 LOG(ERROR) << "Keygen failed: Couldn't generate the signed public key " | 208 LOG(ERROR) << "Keygen failed: Couldn't generate the signed public key " |
209 "and challenge"; | 209 "and challenge"; |
210 return std::string(); | 210 return std::string(); |
211 } | 211 } |
212 | 212 |
213 std::string result; | 213 std::string result; |
214 if (!base::Base64Encode(spkac, &result)) { | 214 base::Base64Encode(spkac, &result); |
215 LOG(ERROR) << "Keygen failed: Couldn't convert signed key into base64"; | |
216 return std::string(); | |
217 } | |
218 | 215 |
219 VLOG(1) << "Keygen succeeded"; | 216 VLOG(1) << "Keygen succeeded"; |
220 return result; | 217 return result; |
221 } | 218 } |
222 } | 219 } |
223 | 220 |
224 } // namespace net | 221 } // namespace net |
OLD | NEW |