Newsgroups: php.general,php.internals,php.qa Path: news.php.net Xref: news.php.net php.general:323453 php.internals:74916 php.qa:67348 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91549 invoked from network); 14 Jun 2014 18:23:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jun 2014 18:23:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=live.webscore@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=live.webscore@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.176 as permitted sender) X-PHP-List-Original-Sender: live.webscore@gmail.com X-Host-Fingerprint: 209.85.217.176 mail-lb0-f176.google.com Received: from [209.85.217.176] ([209.85.217.176:43015] helo=mail-lb0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 60/33-08920-8339C935 for ; Sat, 14 Jun 2014 14:23:53 -0400 Received: by mail-lb0-f176.google.com with SMTP id w7so286433lbi.7 for ; Sat, 14 Jun 2014 11:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Kr04ToKj90v307/FJiZCLme2wPaalIRk4JmLZvVagKM=; b=vUVVGQYlgcnuIfHLY1nN8e1LKi8WpDtm79K1W5vBpUsiUU1iE9iY9kZ+RPQGUndIpt 4lWyAS/tkOYo5Mq/5hK4WPXdREh6DIOMyXnr5+Qu3G+KBIoquSHxebKTWqXdIsZOy669 15Qho0ZT0AwPS9Z/7ZI64c8Oz9iowFl1aPSV8soIxUEkznrc6oOyj5LWmPQRWflFfQdU 6gbsyA9ovE7hwMTXMu7O8Wv2tRo0+qqZDgmvpIXm6VLSvuEk9Gm6z2qeOOWQRePbbQ+x NWGsXhufRlfTy4uoVYBP35o/o37FOSiTfz9TM8wJfabCOh51f5mi07cvMpITOfEm4QgT o9vA== MIME-Version: 1.0 X-Received: by 10.112.198.102 with SMTP id jb6mr6395350lbc.18.1402770229705; Sat, 14 Jun 2014 11:23:49 -0700 (PDT) Received: by 10.152.120.169 with HTTP; Sat, 14 Jun 2014 11:23:49 -0700 (PDT) In-Reply-To: <539C6E15.2030000@gmx.de> References: <539C6E15.2030000@gmx.de> Date: Sat, 14 Jun 2014 20:23:49 +0200 Message-ID: To: Christoph Becker Cc: PHP QA , "php-general@lists.php.net" , PHP Internals Content-Type: multipart/alternative; boundary=001a11c34aa83e433104fbcfe5dd Subject: Re: gnupg_verify help needed From: live.webscore@gmail.com (Tsvetan Nikolov) --001a11c34aa83e433104fbcfe5dd Content-Type: text/plain; charset=UTF-8 Thanks Christoph, This is not sufficient. It returns false only if I enter some random string. If I try to verify signed text with random signature then it always returns an array with some data, which in my case doesn't work because I would like to varify that the text is signed with specific signature and not with any signature. That's the point of gpg! In this case php returns array irrespective of which signature is used to sign the text. Thanks, Tsvetan On Sat, Jun 14, 2014 at 5:45 PM, Christoph Becker wrote: > Tsvetan Nikolov wrote: > > > I've been fighting with gnupg_verify for days now and cannot understand > how > > it works. It returns an array in the form of: > > > > array ( 0 => array ( 'fingerprint' => 'BLABLABLA' 'validity' => 0 > > 'timestamp' => 1402666925 'status' => 117440521 'summary' => 128 ) ) > > > > I don't understand which part of the array actually shows us that the > > verification went well. Do I have to compare the fingerprint or the > status > > is enough. But then I get different statuses and don't know what they all > > mean. Same with summary. On other occasions I get different unexplainable > > results like status=>0 validity=>4. There is no documentation on what > each > > of these means. > > According to : > > | Verifies the given signed_text and returns information about the > | signature. > | ... > | On success, this function returns information about the signature. On > | failure, this function returns FALSE. > > So for basic verification it should suffice to check that the return > value !== false. > > [xpost & fup2 php-general@lists.php.net] > > -- > Christoph M. Becker > --001a11c34aa83e433104fbcfe5dd--