From: Stricted Date: Sun, 28 Jun 2015 07:38:47 +0000 (+0200) Subject: stupid AES mode CCM -.- X-Git-Tag: 1.0.0~13 X-Git-Url: https://git.stricted.de/?p=GitHub%2FStricted%2Fspeedport-hybrid-php-api.git;a=commitdiff_plain;h=c9e082da5cc662b64a74d3770f13d1270068678f;hp=9bd25bb448725e3d09c9fdb2d6d0f0bc3fc71516 stupid AES mode CCM -.- stupid telekom --- diff --git a/speedport.class.php b/speedport.class.php index 1650c5b..83c6b63 100644 --- a/speedport.class.php +++ b/speedport.class.php @@ -29,6 +29,12 @@ class speedport { */ private $url = ''; + /** + * derivedk cookie + * @var string + */ + private $derivedk = ''; + public function __construct ($password, $url = 'http://speedport.ip/') { $this->url = $url; $this->getChallenge(); @@ -79,6 +85,9 @@ class speedport { throw new Exception('unable to get the session cookie from the router'); } + // calculate derivedk + $this->derivedk = hash_pbkdf2('sha1', hash('sha256', $password), substr($this->challenge, 0, 16), 1000, 32); + return true; } } @@ -255,6 +264,19 @@ class speedport { return explode("\n", $data['body']); } + /* + // we cant encrypt and decrypt AES with mode CCM, we need AES with CCM mode for the commands + // (stupid, all other data are send as plaintext and some 'normal' data are encrypted...) + public function reconnectLte () { + $path = 'data/modules.json'; + $fields = array('csrf_token' => 'nulltoken', 'showpw' => 0, 'password' => $this->hash, 'lte_reconn' => 'true'); + $cookie = 'challengev='.$this->challenge.'; '.$this->session; + $data = $this->sentRequest($path, $fields, $cookie); + $json = json_decode($data['body'], true); + + return $json; + } + */ /* public function resetToFactoryDefault () { $path = 'data/resetAllSetting.json'; diff --git a/tests/reconnectlte.php b/tests/reconnectlte.php new file mode 100644 index 0000000..92e26ed --- /dev/null +++ b/tests/reconnectlte.php @@ -0,0 +1,4 @@ +reconnectLte()); +$sp->logout();