Made message signing in Cryptography use SHA512 as the message content for... #1
1 changed files with 16 additions and 2 deletions
|
@ -181,13 +181,27 @@
|
||||||
* @param string|PeerAddress $requester The requester of the message
|
* @param string|PeerAddress $requester The requester of the message
|
||||||
* @return EncryptionMessageRecipient|null The recipient of the message, or null if the requester is not a participant
|
* @return EncryptionMessageRecipient|null The recipient of the message, or null if the requester is not a participant
|
||||||
*/
|
*/
|
||||||
public function determineRecipient(string|PeerAddress $requester): ?EncryptionMessageRecipient
|
public function determineRecipient(string|PeerAddress $requester, bool $reverse=false): ?EncryptionMessageRecipient
|
||||||
{
|
{
|
||||||
if($requester instanceof PeerAddress)
|
if($requester instanceof PeerAddress)
|
||||||
{
|
{
|
||||||
$requester = $requester->getAddress();
|
$requester = $requester->getAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($reverse)
|
||||||
|
{
|
||||||
|
if($this->callingPeerAddress->getAddress() === $requester)
|
||||||
|
{
|
||||||
|
return EncryptionMessageRecipient::SENDER;
|
||||||
|
}
|
||||||
|
elseif($this->receivingPeerAddress->getAddress() === $requester)
|
||||||
|
{
|
||||||
|
return EncryptionMessageRecipient::RECEIVER;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if($this->callingPeerAddress->getAddress() === $requester)
|
if($this->callingPeerAddress->getAddress() === $requester)
|
||||||
{
|
{
|
||||||
return EncryptionMessageRecipient::RECEIVER;
|
return EncryptionMessageRecipient::RECEIVER;
|
||||||
|
|
Loading…
Add table
Reference in a new issue