Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31350 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99710 invoked by uid 1010); 1 Aug 2007 09:36:15 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 99680 invoked from network); 1 Aug 2007 09:36:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Aug 2007 09:36:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=jani.taskinen@sci.fi; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jani.taskinen@sci.fi; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sci.fi from 63.208.196.171 cause and error) X-PHP-List-Original-Sender: jani.taskinen@sci.fi X-Host-Fingerprint: 63.208.196.171 outbound.mailhop.org FreeBSD 4.6-4.9 Received: from [63.208.196.171] ([63.208.196.171:1204] helo=outbound.mailhop.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 36/07-39533-B0450B64 for ; Wed, 01 Aug 2007 05:36:13 -0400 Received: from [81.22.163.71] (helo=[10.6.109.102]) by outbound.mailhop.org with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.63) (envelope-from ) id 1IGAci-000NAu-OF; Wed, 01 Aug 2007 05:36:09 -0400 X-MHO-User: U2FsdGVkX1/H0+ynLpII+AiP0L9laCasNBt8IKZvXqQ= X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 81.22.163.71 X-Report-Abuse-To: abuse@dyndns.com (see http://www.mailhop.org/outbound/abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19NWYDtSU0ebVUyO7JUiNXQLKF6NoggwHM= Reply-To: jani.taskinen@iki.fi To: Dmitry Stogov Cc: internals@lists.php.net In-Reply-To: <002b01c7d419$e6914720$6e02a8c0@thinkpad> References: <002b01c7d419$e6914720$6e02a8c0@thinkpad> Content-Type: text/plain Date: Wed, 01 Aug 2007 12:36:06 +0300 Message-ID: <1185960966.3328.0.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6) Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Ext/OpenSSL patch From: jani.taskinen@sci.fi (Jani Taskinen) You just wasted time posting this here, just commit it. :) --Jani On Wed, 2007-08-01 at 12:56 +0400, Dmitry Stogov wrote: > Hi, > > I propose a patch for ext/openssl that extends support for crypto API. > - it provides access to openSSL digest functions > function openssl_get_md_methods(); > function openssl_digest(string $data, string $method [, bool $raw]); > - it provides access to openSSL digest functions > function openssl_get_cipher_methods(); > function openssl_encrypt(string $data, string $method, $string > $password [, bool $raw]); > function openssl_decrypt(string $data, string $method, $string > $password [, bool $raw]); > - It extends existing functions openssl_pkey_new() and > openssl_pkey_get_details() to access internal values of DSA, RSA and DH > keys. For example you can create DH key and then access its internal values > using the following code: > $dh = openssl_pkey_new(array('dh' => array( > 'p' => pack('H*', 'dcf93a0b883972ec'), > 'g' => pack(H*', '02'))); > $details = openssl_pkey_get_details($dh); > var_dump(base64_encode($deteils['dh']['p'])); > var_dump(base64_encode($deteils['dh']['g'])); > var_dump(base64_encode($deteils['dh']['priv_key'])); > var_dump(base64_encode($deteils['dh']['pub_key'])); > ?> > - it provides new function that computes shared secret for two DH keys > function openssl_dh_compute_key(string $pub_key, resource $dh) > - it also extend some functions to support string name of crypto algorith in > addition to numeric constants. > > This patch was written to implement OpenID protocol in PHP. > It is similar to patch by Wez > http://netevil.org/blog/2007/feb/openid-and-typekey-using-native-openssl-fun > ctions-in-php > but it provides less additional functions and works with big numbers as with > strings (instead of resources). > > I would like to commit the path to PHP_5_2 and HEAD. > Any objections? > > Thanks. Dmitry. > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php