Use uint64_t and avoid down casting as much as possible.

Change-Id: I231d1b3a059907c3806feced7e1b8f1c06575ba5

BUG=chromeos-partner:2912
TEST=make clean all && make runtests

Review URL: http://codereview.chromium.org/6733018
This commit is contained in:
Gaurav Shah
2011-03-25 14:02:13 -07:00
parent 2c7213d4dc
commit d583a30a7c
4 changed files with 16 additions and 16 deletions

View File

@@ -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;
}