U2F-php-server icon indicating copy to clipboard operation
U2F-php-server copied to clipboard

U2FServer::createChallenge() fails in PHP 7.4

Open MauricioFauth opened this issue 6 years ago • 5 comments

Samyoul\U2F\U2FServer\U2FServer::createChallenge() always throws an exception in PHP 7.4.

Samyoul\U2F\U2FServer\U2FException: Unable to obtain a good source of randomness

openssl_random_pseudo_bytes has changed in PHP 7.4.

See RFC: https://wiki.php.net/rfc/improve-openssl-random-pseudo-bytes

MauricioFauth avatar Jun 08 '19 20:06 MauricioFauth

Hey, thank you for this. I have another method of generating random bytes, I will implement a fix for this.

Samyoul avatar Jun 10 '19 10:06 Samyoul

As you can see on https://github.com/code-lts/U2F-php-server/runs/1332881031?check_suite_focus=true in #9 this seems to run fine. Maybe you have an idea why ?

williamdes avatar Oct 30 '20 16:10 williamdes

@Samyoul if we agree to be supporting only php 7 and upwards we could switch to https://www.php.net/manual/en/function.random-bytes.php else add a fallback onto it for php 7+ versions

williamdes avatar Oct 30 '20 16:10 williamdes

@mauriciofauth I can not reproduce this, nor the tests could you help me with this ?

williamdes avatar Dec 12 '21 10:12 williamdes

@mauriciofauth I can not reproduce this, nor the tests could you help me with this ?

I remember it appeared in phpMyAdmin's testsuite, but I don't know how to reproduce it now.

MauricioFauth avatar Dec 20 '21 17:12 MauricioFauth