removing hex2bin to avoid having to add code for this in JS and to not introduce a dependency on paste IDs always having to be hex strings

This commit is contained in:
El RIDO
2019-06-29 11:24:25 +02:00
parent 5651c0f04e
commit 74519f6c4f
6 changed files with 7 additions and 26 deletions

View File

@@ -117,7 +117,7 @@ class Paste extends AbstractModel
// 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'] = base64_encode(hash_hmac(
'sha256', hex2bin($this->getId()), base64_decode($this->_data['meta']['challenge']), true
'sha256', $this->getId(), base64_decode($this->_data['meta']['challenge']), true
));
}