remove calls to removed DRMakeStringHash function

This commit is contained in:
Dario Rekowski on RockPI 2021-03-26 10:49:00 +00:00
parent 0bcc782388
commit 6ea10e2572
4 changed files with 11 additions and 9 deletions

View File

@ -69,14 +69,14 @@ class StateUsersController extends AppController
$this->set(compact('stateUsers'));
}
public function listIdentHashes()
/*public function listIdentHashes()
{
$stateUsers = $this->StateUsers->find('all')->toArray();
foreach ($stateUsers as $i => $user) {
$stateUsers[$i]->identHash = TransactionCreation::DRMakeStringHash($user->email);
}
$this->set('stateUsers', $stateUsers);
}
}*/
public function search()
{

View File

@ -54,12 +54,12 @@ class TransactionCreationsController extends AppController
];
$transactionCreations = $this->paginate($this->TransactionCreations);
$identHashes = [];
foreach ($transactionCreations as $creation) {
/*foreach ($transactionCreations as $creation) {
$identHash = TransactionCreation::DRMakeStringHash($creation->state_user->email);
$identHashes[$creation->state_user->id] = $identHash;
}
}*/
$this->set(compact('transactionCreations', 'identHashes'));
//$this->set(compact('transactionCreations', 'identHashes'));
}
/**
@ -125,7 +125,7 @@ class TransactionCreationsController extends AppController
if (count($receiverProposal) > $receiverIndex) {
$pubKeyHex = $receiverProposal[$receiverIndex]['key'];
$identHash = TransactionCreation::DRMakeStringHash($receiverProposal[$receiverIndex]['email']);
//$identHash = TransactionCreation::DRMakeStringHash($receiverProposal[$receiverIndex]['email']);
}
$builderResult = TransactionCreation::build(
$amountCent,

View File

@ -285,7 +285,7 @@ class TransactionCreation extends TransactionBase {
// intval
//$protoCreation->setIdentHash(intval($identHashBytes));
$protoCreation->setIdentHash(self::DRMakeStringHash($stateUser->email));
//$protoCreation->setIdentHash(self::DRMakeStringHash($stateUser->email));
return new TransactionCreation($protoCreation);
}
}

View File

@ -75,7 +75,8 @@ class TransactionTransfer extends TransactionBase {
foreach($sigPairs as $sigPair) {
//echo 'sig Pair: '; var_dump($sigPair); echo "<br>";
$pubkey = bin2hex($sigPair->getPubKey());
$hash = TransactionCreation::DRMakeStringHash($pubkey);
//$hash = TransactionCreation::DRMakeStringHash($pubkey);
$hash = $pubkey;
if(!isset($sigPubHexs[$hash])) {
$sigPubHexs[$hash] = [$pubkey];
} else {
@ -100,7 +101,8 @@ class TransactionTransfer extends TransactionBase {
return false;
}
// check if signature exist for sender
$hash = TransactionCreation::DRMakeStringHash($senderPublicHex);
//$hash = TransactionCreation::DRMakeStringHash($senderPublicHex);
$hash = $senderPublicHex;
if(!isset($sigPubHexs[$hash]) || in_array($senderPublicHex, $sigPubHexs[$hash]) === FALSE) {
$this->addError($functionName, 'missing signature for sender');
return false;