mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-07-25 07:45:29 -04:00
client side token creation, handle display and single password retry
This commit is contained in:
parent
79db7ddafc
commit
5651c0f04e
9 changed files with 128 additions and 61 deletions
|
@ -116,9 +116,9 @@ class Paste extends AbstractModel
|
|||
$this->_data['meta']['salt'] = serversalt::generate();
|
||||
// if a challenge was sent, we store the HMAC of paste ID & challenge
|
||||
if (array_key_exists('challenge', $this->_data['meta'])) {
|
||||
$this->_data['meta']['challenge'] = hash_hmac(
|
||||
'sha256', $this->getId(), base64_decode($this->_data['meta']['challenge'])
|
||||
);
|
||||
$this->_data['meta']['challenge'] = base64_encode(hash_hmac(
|
||||
'sha256', hex2bin($this->getId()), base64_decode($this->_data['meta']['challenge']), true
|
||||
));
|
||||
}
|
||||
|
||||
// store paste
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue