Skip to content

Commit

Permalink
Fix verifying detached signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Apr 15, 2015
1 parent e635500 commit 5f1df5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion framework/Pgp/lib/Horde/Pgp.php
Expand Up @@ -274,7 +274,12 @@ public function verifyDetached($text, $sig, $key)
$sig = Horde_Pgp_Element_Signature::create($sig);
$data = new Horde_Pgp_Element_SignedMessage(
new OpenPGP_Message(array(
new OpenPGP_LiteralDataPacket($text),
new OpenPGP_LiteralDataPacket(
$text,
array(
'format' => ($sig->message[0]->signature_type === 0x00) ? 'b' : 't'
)
),
$sig->message[0]
))
);
Expand Down
3 changes: 1 addition & 2 deletions framework/Pgp/test/Horde/Pgp/Backend/TestBase.php
Expand Up @@ -380,12 +380,11 @@ public function testSignDetached($text, $privkey)
$result
);

/* TODO: DSA signing is not working properly
$this->testVerifyDetached(
$text,
strval($result),
$privkey->getPublicKey()
); */
);
}

public function signProvider()
Expand Down

0 comments on commit 5f1df5b

Please sign in to comment.