From fedef6b5e163820ca93fcd93d7baeaed5e9f1049 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Tue, 12 May 2015 01:29:01 +0200 Subject: [PATCH] Added missing parameter 2 + wrong hash taken (script dies there). Signed-off-by: Roland Haeder --- application/hub/main/package/class_NetworkPackage.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; } -- 2.39.5