mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 18:25:10 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user