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

random_bytes with php5.6 #22

Closed
hregis opened this issue Aug 18, 2019 · 2 comments
Closed

random_bytes with php5.6 #22

hregis opened this issue Aug 18, 2019 · 2 comments

Comments

@hregis
Copy link

hregis commented Aug 18, 2019

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

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

hregis commented Aug 19, 2019

@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

davidearl pushed a commit that referenced this issue Aug 21, 2019
* added vendor

* added composer json to be released on packagist

* removed trailing comma after string

* fixed MIT license

* Changing rpid to rpId (case sensitive JSON) to be inline with spec.

See for more info: 
https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredentialRequestOptions/rpId

* require versions greater than php 7
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

2 participants