Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81538 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14595 invoked from network); 1 Feb 2015 18:23:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Feb 2015 18:23:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=rdlowrey@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rdlowrey@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.174 as permitted sender) X-PHP-List-Original-Sender: rdlowrey@gmail.com X-Host-Fingerprint: 209.85.213.174 mail-ig0-f174.google.com Received: from [209.85.213.174] ([209.85.213.174:36531] helo=mail-ig0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/92-33325-B2F6EC45 for ; Sun, 01 Feb 2015 13:23:41 -0500 Received: by mail-ig0-f174.google.com with SMTP id b16so13629636igk.1 for ; Sun, 01 Feb 2015 10:23:37 -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=avH0MPggjmWRkgxCr/d1gEmEfNnlbEi4rNmzHKuhOmc=; b=bmF1yIK4QF8oYo/ZNkvobbStzJEdfDTWJAFGgD7ktjZ015FAwx9muGzfC81OL3wgkn EqHl9D2pq4atKbn/ZDMVIKmDunu140wqGg+lmtE4JI2GDJhLKhFB0cIBHgEPhK8kcLc5 ZOJtmDrq4fLzhh79SZ8EyRleuQbNamU300rw3ZJ9gqdgTgoe4sQ2pSaDPStbSHH8jPue vUv+m8Om5nU1rHziDCmqIkWnJMpaTwp12UALkx8mZBoocam7Z5UtZ4Jq4g2rA+OLkCpk JJlu7u+sI/48HZ4jcQHwCnwycSFWIN8AMRKHDSAzBXvOGDYzEQyaZPvoiLsPESrWHwp4 0PUQ== MIME-Version: 1.0 X-Received: by 10.50.138.226 with SMTP id qt2mr8186720igb.1.1422815016138; Sun, 01 Feb 2015 10:23:36 -0800 (PST) Sender: rdlowrey@gmail.com Received: by 10.50.156.198 with HTTP; Sun, 1 Feb 2015 10:23:36 -0800 (PST) In-Reply-To: References: Date: Sun, 1 Feb 2015 13:23:36 -0500 X-Google-Sender-Auth: 9A-44-e7f86l7KgecRNJn_lkMIs Message-ID: To: Jakub Zelenka Cc: Daniel Lowrey , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e0122a2089e3f3a050e0aef01 Subject: Re: [PHP-DEV] Re: OpenSSL ext. improvements for authenticated cipher modes. From: rdlowrey@php.net (Daniel Lowrey) --089e0122a2089e3f3a050e0aef01 Content-Type: text/plain; charset=UTF-8 On Sun, Feb 1, 2015 at 1:07 PM, Jakub Zelenka wrote: > Hey, > > On Sun, Feb 1, 2015 at 5:49 PM, Daniel Lowrey wrote: >> >> - openssl_decrypt() now returns mixed ... if $options['get_tag'] == true >> then return [$decryptedString, $tag], otherwise return $decrypted string >> as >> before to preserve BC. >> - the encrypt function could use $options['set_tag'] to define that (or >> any other secondary information needed for the operation). >> > > I think that you confused it a bit :). The encryption results in cipher > text and a tag. The decryption then validates the tag so you pass the tag > as a parameter. > Okay, you see what I'm getting at :) > Except that it's almost the same what I thought. I'm just not sure that > mixed return value is a good idea. It seems a bit better having tag as a > reference to me. But it's just a small detail that could be added to the > RFC as a choice :) > My personal preference is to minimize the API and not add a sixth (!) parameter (by-ref at that) to the method signature. I see a mixed return with a simplified API as the lesser of the two evils, but like you say that's just bikeshedding and can be part of a brief RFC on the subject. --089e0122a2089e3f3a050e0aef01--