Samyoul / U2F-php-server

Server-side handling of U2F registration and authentication for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

U2FServer::createChallenge() fails in PHP 7.4

MauricioFauth opened this issue · 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

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

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 ?

@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

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

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