php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58030 call to sign method results in 'no signature in result' after 6494 runs
Submitted: 2008-02-05 14:43 UTC Modified: 2015-02-11 18:48 UTC
From: jayanty4 at yahoo dot com Assigned:
Status: Wont fix Package: gnupg (PECL)
PHP Version: 5.1.6 OS: Linux 2.6.18-8.el5 #1 SMP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jayanty4 at yahoo dot com
New email:
PHP Version: OS:

 

 [2008-02-05 14:43 UTC] jayanty4 at yahoo dot com
Description:
------------
We have a server that exposes a webservice method to a command line client. The client gives the server a signature key and the server signs some data and returns that to the client. Off late we have been seeing the 'no signature in result' messages in our error logs at random times from random machines. In trying to replicate the error, I found out that the sign method throws that error after 6494 runs. Please take a look at the code snippet in the 'Reproduce code' to replicate the error

Provided that you have a key with that name in your .gnupg dir, the above code should start throwing the 'no signature in result' error starting from run 6494.

I figured that the work around for this problem was to call the clearsignkeys before I call the addsignkey method.

Reproduce code:
---------------
<?php
  $gpg = new gnupg();
  for($i=0;$i<10000;$i++) {
    $name = 'my_sig_name';
    $gpg->setsignmode( gnupg::SIG_MODE_DETACH );
    $arr = $gpg->keyinfo( $name );
    $fingerprint = $arr[0]['subkeys'][0]['fingerprint'];
    $gpg->addsignkey($fingerprint);
    $dsig = $gpg->sign( "test" );
    if($dsig) {
      print("fine\n");
    }
    else {
      print($gpg->geterror() . "\n");
    }
    //sleep (1);
  }
?>

Expected result:
----------------
I would expect the above snippet to print 'fine' string 10000 times. 

Actual result:
--------------
But it prints 'no signature in result' after 6493 runs.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-02-11 18:48 UTC] jimjag@php.net
-Status: Open +Status: Wont fix
 [2015-02-11 18:48 UTC] jimjag@php.net
OLD - no longer applicable
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 08 00:01:31 2024 UTC