Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81489 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34202 invoked from network); 31 Jan 2015 15:53:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jan 2015 15:53:06 -0000 Authentication-Results: pb1.pair.com header.from=leight@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=leight@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.176 as permitted sender) X-PHP-List-Original-Sender: leight@gmail.com X-Host-Fingerprint: 74.125.82.176 mail-we0-f176.google.com Received: from [74.125.82.176] ([74.125.82.176:42648] helo=mail-we0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/A2-16633-26AFCC45 for ; Sat, 31 Jan 2015 10:53:06 -0500 Received: by mail-we0-f176.google.com with SMTP id w62so31936328wes.7 for ; Sat, 31 Jan 2015 07:53:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=zJyYK2L8oIEBRpxJMVAmLzHRFAnDohY4WR1M8V4PLkY=; b=cOnBAYSMDvbZcR2DSFkERf1vDmn7kxN0khaQ6eFGjXPPu8zqWX+wdoiExf/+7W0KSM DiaOdNkbOnU/i4Q+C6ceQZqO7DJF0hmVsjNZ+hNRLU9OMBZS5hCv/3vANLiX6mXnUjSz NjzEtWkKrLD/9R4Lo6nODQSrbrh8y5RZa7isQK49qGHRCtTWSm37hMsPJD7jw7MMV+44 nAzMaq53D/QArszjRZYltWSvJj5HRyZ97ryElvo8EWq5GNWG8rxATDktNmZXloDkblRf NID4271eCUDD4Yrd7m1zNxzreA2xSUz0jHh7k9RE2rlAS+O/OJF2xccQBs7gPTdv+Y8/ Zfzw== MIME-Version: 1.0 X-Received: by 10.180.5.131 with SMTP id s3mr5957104wis.82.1422719582488; Sat, 31 Jan 2015 07:53:02 -0800 (PST) Received: by 10.216.50.139 with HTTP; Sat, 31 Jan 2015 07:53:02 -0800 (PST) Date: Sat, 31 Jan 2015 15:53:02 +0000 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: OpenSSL ext. improvements for authenticated cipher modes. From: leight@gmail.com (Leigh) Hi list, A couple of bug reports have highlighted the fact that our openssl_encrypt and openssl_decrupt functions have no way of getting or setting tags required for authenticated cipher modes (i.e. GCM, CCM, OCB (not sure if this is available in OpenSSL)). https://bugs.php.net/bug.php?id=68962 https://bugs.php.net/bug.php?id=67304 Further to this, we have no way of setting any associated data. I think we absolutely must provide a method for users to be able to use authenticated encryption, and would like some opinions on how much flexibility we give users, and the best method for exposing this functionality. At the very basic end of the spectrum, we could have openssl_get_tag and openssl_set_tag, or add an extra parameter to the end of openssl_encrypt and openssl_decrypt (pass by ref for encrypt, like preg $matches) this would cover the majority of use cases. However I absolutely think that the associated data also needs to be supported, and possibly the ability to change the tag length. At this point we're starting to get into the territory where an $options array is needed, or we add a lot of parameters to the end of functions. I don't really think it's good to add up to 3 more params to these functions. What do you guys and girls think is the best way of tackling this? Cheers, Leigh.