From b0b2052a9244333bc2b88524dd088bb966e6ed7c Mon Sep 17 00:00:00 2001 From: Stricted Date: Sun, 5 Feb 2017 13:21:18 +0100 Subject: [PATCH] remove debug code --- SpeedportHybrid.class.php | 1 + lib/trait/CryptLib.class.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/SpeedportHybrid.class.php b/SpeedportHybrid.class.php index 06030a6..c135643 100644 --- a/SpeedportHybrid.class.php +++ b/SpeedportHybrid.class.php @@ -121,6 +121,7 @@ class SpeedportHybrid { if (!empty($fields)) { curl_setopt($ch, CURLOPT_POST, true); + if (is_array($fields)) { curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields)); } diff --git a/lib/trait/CryptLib.class.php b/lib/trait/CryptLib.class.php index fb89e96..e321b51 100644 --- a/lib/trait/CryptLib.class.php +++ b/lib/trait/CryptLib.class.php @@ -42,7 +42,6 @@ trait CryptLib { $aes = $factory->getBlockCipher('rijndael-128'); $aes->setKey($key); $mode = $factory->getMode('ccm', $aes, $iv, [ 'adata' => $adata, 'lSize' => 7]); - $mode->decrypt($enc); return $mode->finish(); @@ -67,6 +66,7 @@ trait CryptLib { if (PHP_VERSION_ID >= 70100) { $tag = null; $encdata = openssl_encrypt($data, 'aes-128-ccm', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $iv, $tag, $adata, 8); + return bin2hex($encdata . $tag); } else { @@ -75,7 +75,7 @@ trait CryptLib { $aes->setKey($key); $mode = $factory->getMode('ccm', $aes, $iv, [ 'adata' => $adata, 'lSize' => 7]); $mode->encrypt($data); - var_dump(bin2hex($mode->finish())); + return bin2hex($mode->finish()); } } -- 2.20.1