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

Unified Diff: crypto/symmetric_key_openssl.cc

Issue 1539353003: Switch to standard integer types in crypto/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « crypto/symmetric_key_nss.cc ('k') | crypto/symmetric_key_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/symmetric_key_openssl.cc
diff --git a/crypto/symmetric_key_openssl.cc b/crypto/symmetric_key_openssl.cc
index 912c9b4db2d7468e822cd8062b87ea87432bd16f..2c5358f6274ac3a30128768fd35aa812ebab6e6f 100644
--- a/crypto/symmetric_key_openssl.cc
+++ b/crypto/symmetric_key_openssl.cc
@@ -6,6 +6,8 @@
#include <openssl/evp.h>
#include <openssl/rand.h>
+#include <stddef.h>
+#include <stdint.h>
#include <algorithm>
@@ -39,7 +41,7 @@ SymmetricKey* SymmetricKey::GenerateRandomKey(Algorithm algorithm,
OpenSSLErrStackTracer err_tracer(FROM_HERE);
scoped_ptr<SymmetricKey> key(new SymmetricKey);
- uint8* key_data = reinterpret_cast<uint8*>(
+ uint8_t* key_data = reinterpret_cast<uint8_t*>(
base::WriteInto(&key->key_, key_size_in_bytes + 1));
int rv = RAND_bytes(key_data, static_cast<int>(key_size_in_bytes));
@@ -70,13 +72,12 @@ SymmetricKey* SymmetricKey::DeriveKeyFromPassword(Algorithm algorithm,
OpenSSLErrStackTracer err_tracer(FROM_HERE);
scoped_ptr<SymmetricKey> key(new SymmetricKey);
- uint8* key_data = reinterpret_cast<uint8*>(
+ uint8_t* key_data = reinterpret_cast<uint8_t*>(
base::WriteInto(&key->key_, key_size_in_bytes + 1));
- int rv = PKCS5_PBKDF2_HMAC_SHA1(password.data(), password.length(),
- reinterpret_cast<const uint8*>(salt.data()),
- salt.length(), iterations,
- static_cast<int>(key_size_in_bytes),
- key_data);
+ int rv = PKCS5_PBKDF2_HMAC_SHA1(
+ password.data(), password.length(),
+ reinterpret_cast<const uint8_t*>(salt.data()), salt.length(), iterations,
+ static_cast<int>(key_size_in_bytes), key_data);
return rv == 1 ? key.release() : NULL;
}
« no previous file with comments | « crypto/symmetric_key_nss.cc ('k') | crypto/symmetric_key_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698