Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

U2FServer::createChallenge() fails in PHP 7.4 #6

Open
MauricioFauth opened this issue Jun 8, 2019 · 5 comments
Open

U2FServer::createChallenge() fails in PHP 7.4 #6

MauricioFauth opened this issue Jun 8, 2019 · 5 comments

Comments

@MauricioFauth
Copy link

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

@Samyoul
Copy link
Owner

Samyoul commented Jun 10, 2019

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

williamdes added a commit to code-lts/U2F-php-server that referenced this issue Oct 30, 2020
@williamdes
Copy link

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
Copy link

@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
Copy link

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

@MauricioFauth
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants