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

Unified Diff: net/base/keygen_handler_win.cc

Issue 413763003: clang/win: Fix most -Wwriteable-strings warnings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: net/base/keygen_handler_win.cc
diff --git a/net/base/keygen_handler_win.cc b/net/base/keygen_handler_win.cc
index 59dc69de54c104a2874106194cb310e6d88479a3..f97ada76423ea10191f4236110377f2db4f29d14 100644
--- a/net/base/keygen_handler_win.cc
+++ b/net/base/keygen_handler_win.cc
@@ -36,7 +36,8 @@ bool GetSubjectPublicKeyInfo(HCRYPTPROV prov, std::vector<BYTE>* output) {
// as a CERT_PUBLIC_KEY_INFO structure. Currently, only RSA public keys are
// supported.
ok = CryptExportPublicKeyInfoEx(prov, AT_KEYEXCHANGE, X509_ASN_ENCODING,
- szOID_RSA_RSA, 0, NULL, NULL, &size);
+ const_cast<char*>(szOID_RSA_RSA), 0, NULL,
+ NULL, &size);
DCHECK(ok);
if (!ok)
return false;
@@ -46,8 +47,8 @@ bool GetSubjectPublicKeyInfo(HCRYPTPROV prov, std::vector<BYTE>* output) {
PCERT_PUBLIC_KEY_INFO public_key_casted =
reinterpret_cast<PCERT_PUBLIC_KEY_INFO>(&(*output)[0]);
ok = CryptExportPublicKeyInfoEx(prov, AT_KEYEXCHANGE, X509_ASN_ENCODING,
- szOID_RSA_RSA, 0, NULL, public_key_casted,
- &size);
+ const_cast<char*>(szOID_RSA_RSA), 0, NULL,
+ public_key_casted, &size);
DCHECK(ok);
if (!ok)
return false;
@@ -82,7 +83,7 @@ bool GetSignedPublicKeyAndChallenge(HCRYPTPROV prov,
CRYPT_ALGORITHM_IDENTIFIER sig_alg;
memset(&sig_alg, 0, sizeof(sig_alg));
- sig_alg.pszObjId = szOID_RSA_MD5RSA;
+ sig_alg.pszObjId = const_cast<char*>(szOID_RSA_MD5RSA);
BOOL ok;
DWORD size = 0;

Powered by Google App Engine
This is Rietveld 408576698