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
9 changed files with 128 additions and 61 deletions

View File

@@ -814,7 +814,7 @@ class ControllerTest extends PHPUnit_Framework_TestCase
public function testReadBurnAfterReadingWithToken()
{
$token = base64_encode(hash_hmac(
'sha256', Helper::getPasteId(), random_bytes(32)
'sha256', hex2bin(Helper::getPasteId()), random_bytes(32), true
));
$burnPaste = Helper::getPaste(2, array('challenge' => $token));
$burnPaste['adata'][3] = 1;
@@ -839,7 +839,7 @@ class ControllerTest extends PHPUnit_Framework_TestCase
public function testReadBurnAfterReadingWithIncorrectToken()
{
$token = base64_encode(hash_hmac(
'sha256', Helper::getPasteId(), random_bytes(32)
'sha256', hex2bin(Helper::getPasteId()), random_bytes(32), true
));
$burnPaste = Helper::getPaste(2, array('challenge' => base64_encode(random_bytes(32))));
$burnPaste['adata'][3] = 1;