From 2266affa5b474c2258565ace8b20a40d6ea30f64 Mon Sep 17 00:00:00 2001 From: djmaze Date: Fri, 20 Mar 2020 16:14:36 +0100 Subject: [PATCH] Add support for PECL xxtea --- rainloop/v/0.0.0/app/libraries/MailSo/Base/Crypt.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Crypt.php b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Crypt.php index f21bdbca9..152a0c902 100644 --- a/rainloop/v/0.0.0/app/libraries/MailSo/Base/Crypt.php +++ b/rainloop/v/0.0.0/app/libraries/MailSo/Base/Crypt.php @@ -31,6 +31,10 @@ class Crypt return ''; } + if (\is_callable('xxtea_encrypt')) { + return xxtea_encrypt($sString, $sKey); + } + $aV = self::str2long($sString, true); $aK = self::str2long($sKey, false); if (\count($aK) < 4) @@ -80,6 +84,10 @@ class Crypt return ''; } + if (\is_callable('xxtea_decrypt')) { + return xxtea_decrypt($sEncriptedString, $sKey); + } + $aV = self::str2long($sEncriptedString, false); $aK = self::str2long($sKey, false); @@ -186,4 +194,4 @@ class Crypt } return (int) $iN; } -} \ No newline at end of file +}