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

Unified Diff: firmware/lib/vboot_common.c

Issue 6733018: Use uint64_t and avoid down casting as much as possible. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Created 9 years, 9 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
« no previous file with comments | « firmware/lib/cryptolib/rsa_utility.c ('k') | host/lib/host_key.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/vboot_common.c
diff --git a/firmware/lib/vboot_common.c b/firmware/lib/vboot_common.c
index edc6e163b88b84163e2f5a1d6e446765f1898845..28d016ea1110b251f7b5dd8b3bcd392cc4d08cdf 100644
--- a/firmware/lib/vboot_common.c
+++ b/firmware/lib/vboot_common.c
@@ -115,23 +115,23 @@ int PublicKeyCopy(VbPublicKey* dest, const VbPublicKey* src) {
RSAPublicKey* PublicKeyToRSA(const VbPublicKey* key) {
RSAPublicKey *rsa;
- int key_size;
+ uint64_t key_size;
if (kNumAlgorithms <= key->algorithm) {
VBDEBUG(("Invalid algorithm.\n"));
return NULL;
}
- if (!RSAProcessedKeySize((int)key->algorithm, &key_size) ||
- key_size != (int)key->key_size) {
+ if (!RSAProcessedKeySize(key->algorithm, &key_size) ||
+ key_size != key->key_size) {
VBDEBUG(("Wrong key size for algorithm\n"));
return NULL;
}
- rsa = RSAPublicKeyFromBuf(GetPublicKeyDataC(key), (int)key->key_size);
+ rsa = RSAPublicKeyFromBuf(GetPublicKeyDataC(key), key->key_size);
if (!rsa)
return NULL;
- rsa->algorithm = (int)key->algorithm;
+ rsa->algorithm = (unsigned int)key->algorithm;
return rsa;
}
« no previous file with comments | « firmware/lib/cryptolib/rsa_utility.c ('k') | host/lib/host_key.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698