davidearl / webauthn

An implementation of webauthn in PHP on the server side (e.g Yubico 2 and Google Titan keys)
https://webauthn.davidearl.uk
MIT License
129 stars 24 forks source link

random_bytes with php5.6 #22

Closed hregis closed 4 years ago

hregis commented 4 years ago

Hello

you use "random_bytes" function, this function is only in php 7+

we should either limit the "compose" with php 7+

OR use this library to make it compatible with php 5.6 https://github.com/paragonie/random_compat

OR use "openssl_random_pseudo_bytes" compatible with 5.6 and 7+

Thanks

davidearl commented 4 years ago

Yes, you're right. I'm tempted to say PHP 7 only as PHP5.6 is no longer supported, but it does still seem to be in widespread use, so I'll look at using openssl for this for older versions. It may be a while before I can get to do this.

hregis commented 4 years ago

@davidearl i install manually this library with your library and all works with php5.6

https://github.com/paragonie/random_compat

"random_compat" detect if you use php7+ or not