Re: [PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes()

2019-11-07 Thread Björn Larsson
Den 2019-11-06 kl. 20:44, skrev Jakub Zelenka: On Wed, Oct 30, 2019 at 6:33 PM Jakub Zelenka wrote: On Wed, 30 Oct 2019, 18:32 Jakub Zelenka, wrote: On Mon, 23 Sep 2019, 14:02 Nikita Popov, wrote: On Mon, Sep 23, 2019 at 2:52 PM Christian Schneider < cschn...@cschneid.com> wrote: Hi,

Re: [PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes()

2019-11-07 Thread Rowan Tommins
On Wed, 6 Nov 2019 at 19:44, Jakub Zelenka wrote: > I have to say that the RFC wasn't really well done as the implementation > followed which caused this omission. We should really look properly to the > implementation when creating RFC so it's more detailed and doesn't cause > omission like this

Re: [PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes()

2019-11-06 Thread Jakub Zelenka
On Wed, Oct 30, 2019 at 6:33 PM Jakub Zelenka wrote: > > > On Wed, 30 Oct 2019, 18:32 Jakub Zelenka, wrote: > >> >> >> On Mon, 23 Sep 2019, 14:02 Nikita Popov, wrote: >> >>> On Mon, Sep 23, 2019 at 2:52 PM Christian Schneider < >>> cschn...@cschneid.com> >>> wrote: >>> >>> > Hi, >>> > I just no

Re: [PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes()

2019-10-30 Thread Jakub Zelenka
On Wed, 30 Oct 2019, 18:32 Jakub Zelenka, wrote: > > > On Mon, 23 Sep 2019, 14:02 Nikita Popov, wrote: > >> On Mon, Sep 23, 2019 at 2:52 PM Christian Schneider < >> cschn...@cschneid.com> >> wrote: >> >> > Hi, >> > I just noted (too late in the process, I know) that >> > openssl_random_pseudo_by

Re: [PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes()

2019-10-30 Thread Jakub Zelenka
On Mon, 23 Sep 2019, 14:02 Nikita Popov, wrote: > On Mon, Sep 23, 2019 at 2:52 PM Christian Schneider > > wrote: > > > Hi, > > I just noted (too late in the process, I know) that > > openssl_random_pseudo_bytes(0) now throws an exception. > > > > This breaks code like > > $ivsize = opens

Re: [PHP-DEV] RFCs should mention all BC breaks (was Re: [PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes())

2019-09-25 Thread Christian Schneider
Am 25.09.2019 um 03:47 schrieb Pierre Joye : > The question is also about what is a BC break, f.e is changing error level > a BC break? or the return value on error? This seems to be a complicated question but I think if we boil it down to a guideline instead of a hard rule it is not that hard

Re: [PHP-DEV] Re: RFCs should mention all BC breaks (was Re: [PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes())

2019-09-24 Thread Pierre Joye
On Tue, Sep 24, 2019, 3:11 PM Christian Schneider wrote: > > So here is my question: Am I the only one who thinks BC breaks should be > fully covered in an RFC before voting? > If I am not mistaken this is the rule yes. A specific section should exist to list BC breaks. Also a BC break is not

Re: [PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes()

2019-09-24 Thread Rowan Tommins
On Tue, 24 Sep 2019 at 15:26, Larry Garfield wrote: > And no, random_int(0,0) does what it says on the tin: return a random int > between 0 and 0. If you call it that way, well, it's your own PEBCAK. But > it throws an exception if the underlying sources of entropy are not working > for some re

Re: [PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes()

2019-09-24 Thread Larry Garfield
On Mon, Sep 23, 2019, at 11:34 AM, Christian Schneider wrote: > Am 23.09.2019 um 17:16 schrieb Larry Garfield : > > I cannot speak for OpenSSL, but random_bytes() and random_int() were > > changed very late in the 7.0 cycle to throw exceptions so that they "fail > > closed". Otherwise if you ex

[PHP-DEV] Re: RFCs should mention all BC breaks (was Re: [PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes())

2019-09-24 Thread Christian Schneider
Am 24.09.2019 um 06:18 schrieb Pierre Joye : > On Mon, Sep 23, 2019 at 10:17 PM Larry Garfield > wrote: > >> I cannot speak for OpenSSL, but random_bytes() and random_int() were >> changed very late in the 7.0 cycle to throw exceptions so that they "fail >> closed". Otherwise if you expect a

Re: [PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes()

2019-09-23 Thread Pierre Joye
On Mon, Sep 23, 2019 at 10:17 PM Larry Garfield wrote: > I cannot speak for OpenSSL, but random_bytes() and random_int() were changed > very late in the 7.0 cycle to throw exceptions so that they "fail closed". > Otherwise if you expect a random value back but get a constant value (false > o

Re: [PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes()

2019-09-23 Thread M. W. Moe
Hello, "A little side-node: random_int(0, 0) does not throw an exception which makes random_bytes and random_int inconsistent by your logic ;-)" not really; there are still different functions; hence they can differ in their behavior; + that's not a matter of individual logic but an api choice; e

Re: [PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes()

2019-09-23 Thread Christian Schneider
Am 23.09.2019 um 17:16 schrieb Larry Garfield : > I cannot speak for OpenSSL, but random_bytes() and random_int() were changed > very late in the 7.0 cycle to throw exceptions so that they "fail closed". > Otherwise if you expect a random value back but get a constant value (false > or empty s

Re: [PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes()

2019-09-23 Thread Larry Garfield
On Mon, Sep 23, 2019, at 6:01 AM, Nikita Popov wrote: > On Mon, Sep 23, 2019 at 2:52 PM Christian Schneider > wrote: > > > Hi, > > I just noted (too late in the process, I know) that > > openssl_random_pseudo_bytes(0) now throws an exception. > > > > This breaks code like > > $ivsize = op

Re: [PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes()

2019-09-23 Thread Nikita Popov
On Mon, Sep 23, 2019 at 2:52 PM Christian Schneider wrote: > Hi, > I just noted (too late in the process, I know) that > openssl_random_pseudo_bytes(0) now throws an exception. > > This breaks code like > $ivsize = openssl_cipher_iv_length($method); > $iv = openssl_random_pseudo_b

[PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes()

2019-09-23 Thread Christian Schneider
Hi, I just noted (too late in the process, I know) that openssl_random_pseudo_bytes(0) now throws an exception. This breaks code like $ivsize = openssl_cipher_iv_length($method); $iv = openssl_random_pseudo_bytes($ivsize); $data = openssl_encrypt($string, $method, $key, OP