stupid AES mode CCM -.-
authorStricted <info@stricted.de>
Sun, 28 Jun 2015 07:38:47 +0000 (09:38 +0200)
committerStricted <info@stricted.de>
Sun, 28 Jun 2015 07:38:47 +0000 (09:38 +0200)
stupid telekom

speedport.class.php
tests/reconnectlte.php [new file with mode: 0644]

index 1650c5b98427967b5e31eb7d112706cb06cad025..83c6b638312d1f8f8fd942b5169ecd2a8b09eec8 100644 (file)
@@ -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 (file)
index 0000000..92e26ed
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+require_once('config.php');
+print_r($sp->reconnectLte());
+$sp->logout();