client side token creation, handle display and single password retry

This commit is contained in:
El RIDO 2019-06-29 10:49:44 +02:00
parent 79db7ddafc
commit 5651c0f04e
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
9 changed files with 128 additions and 61 deletions

View file

@ -276,9 +276,9 @@ class ModelTest extends PHPUnit_Framework_TestCase
{
$pasteData = Helper::getPastePost();
$pasteData['meta']['challenge'] = base64_encode(random_bytes(32));
$token = hash_hmac(
'sha256', Helper::getPasteId(), base64_decode($pasteData['meta']['challenge'])
);
$token = base64_encode(hash_hmac(
'sha256', hex2bin(Helper::getPasteId()), base64_decode($pasteData['meta']['challenge']), true
));
$this->_model->getPaste(Helper::getPasteId())->delete();
$paste = $this->_model->getPaste(Helper::getPasteId());
$this->assertFalse($paste->exists(), 'paste does not yet exist');