From: Stricted Date: Sun, 5 Feb 2017 12:21:18 +0000 (+0100) Subject: remove debug code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b0b2052a9244333bc2b88524dd088bb966e6ed7c;p=GitHub%2FStricted%2Fspeedport-hybrid-php-api.git remove debug code --- 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()); } }