Re: PHP 7.4 BC break with openssl_random_pseudo_bytes()

From: Date: Mon, 23 Sep 2019 18:37:02 +0000
Subject: Re: PHP 7.4 BC break with openssl_random_pseudo_bytes()
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-107303@lists.php.net to get a copy of this message
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; everything can be argued *; however, I don't see any BC break here but a addon instead of failing silently, like it was before; hiding a very wrong state. Regards. * the smiley doesn't help. On Mon, Sep 23, 2019 at 9:34 AM Christian Schneider <cschneid@cschneid.com> wrote: > Am 23.09.2019 um 17:16 schrieb Larry Garfield <larry@garfieldtech.com>: > > 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 string), if you don't remember to check it yourself > every time then you now have a security hole because you're using a > constant seed for random-dependent behavior. > > I see your point but I'm still not convinced that it is worth the BC. > But whatever is decided for this specific change, I'm more interested in > handling this properly for future RFCs, i.e. people should get the full > picture concerning BC before voting. > > A little side-node: random_int(0, 0) does not throw an exception which > makes random_bytes and random_int inconsistent by your logic ;-) > > - Chris > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.internals (#107303) next »