From: Roland Haeder Date: Mon, 11 May 2015 23:29:01 +0000 (+0200) Subject: Added missing parameter 2 + wrong hash taken (script dies there). X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fedef6b5e163820ca93fcd93d7baeaed5e9f1049;p=hub.git Added missing parameter 2 + wrong hash taken (script dies there). Signed-off-by: Roland Haeder --- diff --git a/application/hub/main/package/class_NetworkPackage.php b/application/hub/main/package/class_NetworkPackage.php index 1fb38d160..fe3ebe81e 100644 --- a/application/hub/main/package/class_NetworkPackage.php +++ b/application/hub/main/package/class_NetworkPackage.php @@ -359,6 +359,8 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R } // END - if // Make sure the requested element is there + // @TODO Wrong hash!!!! + /* DEBUG-DIE */ die('decodedData=' . print_r($decodedData, TRUE)); assert(isset($decodedData[self::INDEX_PACKAGE_HASH])); // There is no DHT entry so, accept the hash from decoded data @@ -673,10 +675,11 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R */ private function isPackageHashValid (array $decodedArray) { // Check validity - $isHashValid = Scrypt::checkScrypt($decodedArray[self::INDEX_PACKAGE_SENDER] . ':' . $decodedArray[self::INDEX_PACKAGE_CONTENT] . ':' . $this->determineSenderPrivateKeyHash($decodedArray)); + //* DEBUG-DIE: */ die(__METHOD__ . ': decodedArray=' . print_r($decodedArray, TRUE)); + $isHashValid = Scrypt::checkScrypt($decodedArray[self::INDEX_PACKAGE_SENDER] . ':' . $decodedArray[self::INDEX_PACKAGE_CONTENT] . ':' . $this->determineSenderPrivateKeyHash($decodedArray), $decodedArray[self::INDEX_PACKAGE_HASH]); // Return it - //* DEBUG-DIE: */ die(__METHOD__ . ': isHashValid=' . intval($isHashValid) . chr(10) . ',decodedArray=' . print_r($decodedArray, TRUE)); + //* DEBUG-DIE: */ die(__METHOD__ . ': isHashValid=' . intval($isHashValid) . ',decodedArray=' . print_r($decodedArray, TRUE)); return $isHashValid; }