From b5b763b3f2e709ac2044f6443289fcc368a492ec Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 23 Mar 2019 20:17:43 -0500 Subject: [PATCH] RSA: use hash_equals if available --- phpseclib/Crypt/RSA.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index 3be36c88..1a35a274 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -2301,6 +2301,10 @@ class Crypt_RSA */ function _equals($x, $y) { + if (function_exists('hash_equals')) { + return hash_equals($x, $y); + } + if (strlen($x) != strlen($y)) { return false; }