Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107306 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 56728 invoked from network); 24 Sep 2019 06:40:01 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 24 Sep 2019 06:40:01 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id A7F272CFDBF for ; Mon, 23 Sep 2019 21:18:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: X-Spam-Virus: No Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Mon, 23 Sep 2019 21:18:49 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id i16so413887wmd.3 for ; Mon, 23 Sep 2019 21:18:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=dVJ9zGUfNI8PkQiV7pfq7+8j/qrZaDITfvxRSAZu7Sg=; b=Ehd1Vf1lMBSiAArhp64u+eQQ0rMKcp3FNc1XcFLDhwDyNkr9evcIK8MM9bF7/lThnF xcVHNLecv2KYYkJSqkIS3FkVgLzb2pCC5D51+9cs9SvODfudyL2t8rq4+Xi7wD4SSU3k U++cjYzH4wYYcnSvanF7XeLpgoHxQ+IkDN9/w0YYL9l+25LhKWlbU0ikbcO0YI1m0UXy rt2SU45ZJL9QBq8xaaqZeNiUF9zQpBOYVK5lNrmpxXHEugwu0xcSwfGf/jjN8TWMUeKw lNppACIw4CDp7W7syribFPWYgS3NzoFxN66NIfVMJiTYO6Eye1ru1vLqEGXX4Gis7Jpi TgqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=dVJ9zGUfNI8PkQiV7pfq7+8j/qrZaDITfvxRSAZu7Sg=; b=j7oabdWoXQf5gOAb3NUD7uQFKD4FBjtWwhBQnr9xFfr/fT937WNGx/CL2nVGNGpQBU nMNdwuoUtF8d7OedPu52dE1aNu4cdOO9K04KwkCsHATdcnzdEl2Kv5EgE/laNXrn3o+s dihq5bzW2nNlKLd/kcCLZ5bebRPB9FjHc2YC4WZnzGCrlCmaI0S0tZfXOyVeyEvmNBz4 NwQnJREn6TakzMrABKJQW2ouOggmrmfNb3pf1D6uZ2W3LtEatmozcje3gykmgQtqqLaL NaUvvIa0ts8IYiIUToG0vZA3bVz5NeLrwYj9Aay/u5Wi4wa4Msf53onFf+v6suSLzLK0 kgrA== X-Gm-Message-State: APjAAAWY6Hj+4UmRlWzIxNS0TeL0/g4QOwbaZxADRNJhCSwStchOUUAg n2lJbjaPS4zpd97uiHQpKx5z8c8KuuCx4B5Tb0w88A== X-Google-Smtp-Source: APXvYqxSjXnyHGRpYKc44f4MugsEXdjmD0msbQlOBSFkFTb1hO+yMw2L7077U8WMaKRr2cqnjVdFNRL9zw35W0IO1h4= X-Received: by 2002:a05:600c:1009:: with SMTP id c9mr759484wmc.64.1569298727936; Mon, 23 Sep 2019 21:18:47 -0700 (PDT) MIME-Version: 1.0 References: <696dc114-c2df-40aa-aad6-5b87d4373c0e@www.fastmail.com> In-Reply-To: <696dc114-c2df-40aa-aad6-5b87d4373c0e@www.fastmail.com> Date: Tue, 24 Sep 2019 11:18:35 +0700 Message-ID: To: Larry Garfield Cc: php internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Envelope-From: Subject: Re: [PHP-DEV] PHP 7.4 BC break with openssl_random_pseudo_bytes() From: pierre.php@gmail.com (Pierre Joye) On Mon, Sep 23, 2019 at 10:17 PM Larry Garfield wr= ote: > I cannot speak for OpenSSL, but random_bytes() and random_int() were cha= nged very late in the 7.0 cycle to throw exceptions so that they "fail clos= ed". 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 t= ime then you now have a security hole because you're using a constant seed = for random-dependent behavior. > > That was a good change, and it should be kept that way, IMO. Fully agree. This is actually pretty the only way to handle errors with these functions. Anything else creates a risk that we could have easily prevented. Best, --=20 Pierre @pierrejoye | http://www.libgd.org