|
|
@@ -56,6 +56,7 @@ |
|
|
|
|
|
|
|
#include <openssl/rsa.h> |
|
|
|
|
|
|
|
#include <limits.h> |
|
|
|
#include <string.h> |
|
|
|
|
|
|
|
#include <openssl/bn.h> |
|
|
@@ -240,7 +241,7 @@ int RSA_decrypt(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, |
|
|
|
padding); |
|
|
|
} |
|
|
|
|
|
|
|
int RSA_private_decrypt(int flen, const uint8_t *from, uint8_t *to, RSA *rsa, |
|
|
|
int RSA_private_decrypt(size_t flen, const uint8_t *from, uint8_t *to, RSA *rsa, |
|
|
|
int padding) { |
|
|
|
size_t out_len; |
|
|
|
|
|
|
@@ -248,6 +249,10 @@ int RSA_private_decrypt(int flen, const uint8_t *from, uint8_t *to, RSA *rsa, |
|
|
|
return -1; |
|
|
|
} |
|
|
|
|
|
|
|
if (out_len > INT_MAX) { |
|
|
|
OPENSSL_PUT_ERROR(RSA, ERR_R_OVERFLOW); |
|
|
|
return -1; |
|
|
|
} |
|
|
|
return out_len; |
|
|
|
} |
|
|
|
|
|
|
|