Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90892 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48937 invoked from network); 24 Jan 2016 21:17:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jan 2016 21:17:30 -0000 Authentication-Results: pb1.pair.com header.from=jakub.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jakub.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.44 as permitted sender) X-PHP-List-Original-Sender: jakub.php@gmail.com X-Host-Fingerprint: 209.85.213.44 mail-vk0-f44.google.com Received: from [209.85.213.44] ([209.85.213.44:32780] helo=mail-vk0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A1/11-42451-96F35A65 for ; Sun, 24 Jan 2016 16:17:29 -0500 Received: by mail-vk0-f44.google.com with SMTP id e64so65449785vkg.0 for ; Sun, 24 Jan 2016 13:17:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=PSMz1TYfWrj+axM+DGKTBziuz4Kpmg8Lg2Yk26QhDh0=; b=rDhuS9+eoWFtlZ69CdsL6cer+2WNu8avThr9dBlrWvuTvCbeEXxKtyC7L/lkaKe1vX 8azwc+sT0ChpYe626dsuyT1C8urwWCNczh19DGngefvgw9WxVDdWIIdoA/7f8W6GAsqn iuD6XcRxDP90PMVTKB9cAW4LranFyiEkYP0vFDkNrw88LtaCCx5fAhqAjQdlhNd5SnE4 1YaAoERcKN4GO5mm0WHUHFwMa42LSSAEYbod5zZBPc5JGKHzTgdUyQrZhu578xduodl7 1ySZo1MdZXuJmgxmEJjxvPnulg8cazErDo/jY1vVK/FaRpbiNqms1XJwf6zvAjrhlDkX IORA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=PSMz1TYfWrj+axM+DGKTBziuz4Kpmg8Lg2Yk26QhDh0=; b=FTQAawe+Jke6404lI0VMPk24VZaUz4OwJjaYI7P9cSIKWkWLYsvmNWggOYxorDsJXN JTp0HdyE/GpKodsuqpYNNAlN0D3+7Jib5CaE0eezoAYAPKX0x9X0xq6wCznLUtVHiFgg 6cf4oDBbmP2GrxMW7QvAYnJXyao2CwcCU+EuAVanrLzPho6bWT0WIUD2tS2Tif5DFYQh bo6Z7jbkhBpoR8AtP0TOnYMrtgtPJ/2I3Q2WmBIpeIZm/4rtX3A1AAhtSSm9ESpAo6vZ qPkfB1RUT3pGW1IuDqFNCWKcjftVGLNgRhcVOoNQHExTOeBk+xSolILB4SJdWkymYXqw +BnQ== X-Gm-Message-State: AG10YOSztI6udQmNO8vn+lCwtm852e72OppAkTy/c4goIWc/nxRWouS+S9OHbUSVCkIj/n162IigLH1nih+K8w== MIME-Version: 1.0 X-Received: by 10.31.162.20 with SMTP id l20mr8100586vke.137.1453670246525; Sun, 24 Jan 2016 13:17:26 -0800 (PST) Sender: jakub.php@gmail.com Received: by 10.31.96.214 with HTTP; Sun, 24 Jan 2016 13:17:26 -0800 (PST) Received: by 10.31.96.214 with HTTP; Sun, 24 Jan 2016 13:17:26 -0800 (PST) In-Reply-To: References: Date: Sun, 24 Jan 2016 21:17:26 +0000 X-Google-Sender-Auth: kdErpiwZBz7lTEB9AiMj6ujMvtc Message-ID: To: Marco Pivetta Cc: PHP internals list Content-Type: multipart/alternative; boundary=001a1143f2acaa3170052a1afacf Subject: Re: [PHP-DEV] [RFC][VOTE] OpenSSL AEAD support From: bukka@php.net (Jakub Zelenka) --001a1143f2acaa3170052a1afacf Content-Type: text/plain; charset=UTF-8 On 24 Jan 2016 19:44, "Marco Pivetta" wrote: > > On 24 January 2016 at 20:34, Jakub Zelenka wrote: >> >> On 24 Jan 2016 14:49, "Marco Pivetta" >> > >> > The BC breaks may happen in future, given the number of added parameters. You even designed your additional parameters to avoid BC breaks: what will happen next time someone needs additional functionality? >> >> I'm not aware about any new functionality that could be added here in the near future and even if there was any, new parameters can still be added. I'm pretty sure that once this happens we will have already named params support which should address all your concerns. I actualy think that with the named params this will be much better API change than all other propasals. > > > Exactly: like anyone else, you are not yet aware about it. What happens in 5 years? Of course I don't know what happens in 5 years but even if we needed to add new parameters, it wouldn't be a BC break. >> >> I'm sorry but I don't think we should add any objects here. OpenSSL ext is purely procedural and objects wouldn't fit. It would also require some code reordering and clean up. > > Doesn't really matter if you design it with an object or with optional parameters, or even with an array of `$options`, as long as you can enforce correct types passed in, and the order of the default parameter values doesn't become a mess (as it currently is becoming). I don't think that array would be an option as it's not realy nice when a tag would be returned into it (tag is a ref and filled after encryption)... the correct types are already enforced in the current implementation (warning is triggered if they are not correct). About the order, the only default is the last paremeter so I don't see any issue here either. As I said I really think that we will get named params before there is any need to add another param. After that the current API will be really good (just look how many parameters are often in Python libraries). >> >> >> >> That being said I know that the current proposal is not the nicest but I think it fits to the current openssl ext API which is not the nicest either. >> > >> > This is indeed an adapter: if OpenSSL sucks, then don't jump off the bridge as well ;-) >> >> I have never said that OpenSSL sucks. :) It's a great library written by one of the smartest people in the world. I meant that our openssl extension doesn't have the nicest API. However the API is more or less done in the same style which we shouldn't change IMHO. > > I write loads of stuff that may or may not suck from a consumer perspective. I am blaming the API, not the developer, let's not bring it to a personal level. Apology if it seemed that I'm bringing it on personal level. That wasn't my intention. What I was trying to say is that I think we should try to keep the extension consistent. I think that your idea is good in general but it doesn't fit to the openssl ext in my opinion. > > We are designing (changing, eek!) an API here: the fact that it may or not reflect how OpenSSL itself exposes it is totally irrelevant. The OpenSSL libcrypto API was never the point here. I might have been a bit unclear. If so, then I apologise. I actually meant other PHP functions from openssl core extension (those starting with openssl_). There are no other objects in the extension, just resources and functions with many parameters. Some of them also using refs for out params. I also think that it's more conforming with the openssl_encrypt and openssl_decrypt that got iv parameter at some later point. We don't have a new pair of functions with and without iv though... Cheers Jakub --001a1143f2acaa3170052a1afacf--