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

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

Issue 1507413003: clang/win: Let some chromium_code targets build with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: content_browsertests Created 5 years 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 | « media/capture/video/win/video_capture_device_mf_win.cc ('k') | net/cert/test_root_certs_win.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 <rpc.h> 8 #include <rpc.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 if (key_container.key_id_.empty()) 176 if (key_container.key_id_.empty())
177 return std::string(); 177 return std::string();
178 178
179 // Only create new key containers, so that existing key containers are not 179 // Only create new key containers, so that existing key containers are not
180 // overwritten. 180 // overwritten.
181 if (crypto::CryptAcquireContextLocked(key_container.provider_.receive(), 181 if (crypto::CryptAcquireContextLocked(key_container.provider_.receive(),
182 key_container.key_id_.c_str(), NULL, PROV_RSA_FULL, 182 key_container.key_id_.c_str(), NULL, PROV_RSA_FULL,
183 CRYPT_SILENT | CRYPT_NEWKEYSET)) 183 CRYPT_SILENT | CRYPT_NEWKEYSET))
184 break; 184 break;
185 185
186 if (GetLastError() != NTE_BAD_KEYSET) { 186 if (GetLastError() != static_cast<DWORD>(NTE_BAD_KEYSET)) {
187 LOG(ERROR) << "Keygen failed: Couldn't acquire a CryptoAPI provider " 187 LOG(ERROR) << "Keygen failed: Couldn't acquire a CryptoAPI provider "
188 "context: " << GetLastError(); 188 "context: " << GetLastError();
189 return std::string(); 189 return std::string();
190 } 190 }
191 } 191 }
192 if (attempt == kMaxAttempts) { 192 if (attempt == kMaxAttempts) {
193 LOG(ERROR) << "Keygen failed: Couldn't acquire a CryptoAPI provider " 193 LOG(ERROR) << "Keygen failed: Couldn't acquire a CryptoAPI provider "
194 "context: Max retries exceeded"; 194 "context: Max retries exceeded";
195 return std::string(); 195 return std::string();
196 } 196 }
(...skipping 16 matching lines...) Expand all
213 213
214 std::string result; 214 std::string result;
215 base::Base64Encode(spkac, &result); 215 base::Base64Encode(spkac, &result);
216 216
217 VLOG(1) << "Keygen succeeded"; 217 VLOG(1) << "Keygen succeeded";
218 return result; 218 return result;
219 } 219 }
220 } 220 }
221 221
222 } // namespace net 222 } // namespace net
OLDNEW
« no previous file with comments | « media/capture/video/win/video_capture_device_mf_win.cc ('k') | net/cert/test_root_certs_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698