Remove cast when using BoringSSL.
BoringSSL defines RSA_size as returning an unsigned, as one would hope.
No cast is needed in that case.
Change-Id: Ifc596af987a6abce40f685d66adb63aee4709666
diff --git a/rsa_operation.cpp b/rsa_operation.cpp
index 4eef5c1..a013b78 100644
--- a/rsa_operation.cpp
+++ b/rsa_operation.cpp
@@ -60,9 +60,14 @@
}
keymaster_error_t RsaVerifyOperation::Finish(const Buffer& signature, Buffer* /* output */) {
-
+#if defined(OPENSSL_IS_BORINGSSL)
+ if (data_.available_read() != RSA_size(rsa_key_))
+ return KM_ERROR_INVALID_INPUT_LENGTH;
+#else
if ((int)data_.available_read() != RSA_size(rsa_key_))
return KM_ERROR_INVALID_INPUT_LENGTH;
+#endif
+
if (data_.available_read() != signature.available_read())
return KM_ERROR_VERIFICATION_FAILED;