Index: firmware/lib/vboot_common.c |
diff --git a/firmware/lib/vboot_common.c b/firmware/lib/vboot_common.c |
index 2635fe64a12910c5c8ae31e827830f81d2896c12..32bb7dc3a7ba186798ec6fda2209a42d3479ef57 100644 |
--- a/firmware/lib/vboot_common.c |
+++ b/firmware/lib/vboot_common.c |
@@ -107,12 +107,14 @@ int PublicKeyCopy(VbPublicKey* dest, const VbPublicKey* src) { |
RSAPublicKey* PublicKeyToRSA(const VbPublicKey* key) { |
RSAPublicKey *rsa; |
+ int key_size; |
if (kNumAlgorithms <= key->algorithm) { |
VBDEBUG(("Invalid algorithm.\n")); |
return NULL; |
} |
- if (RSAProcessedKeySize((int)key->algorithm) != (int)key->key_size) { |
+ if (!RSAProcessedKeySize((int)key->algorithm, &key_size) || |
+ key_size != (int)key->key_size) { |
VBDEBUG(("Wrong key size for algorithm\n")); |
return NULL; |
} |