DSA/Signatures/SSH2: self generated signatures wouldn't verify

This commit is contained in:
terrafrost 2017-07-30 16:03:47 -05:00
parent 610d3d6ea0
commit 4a7d3d27ba

View File

@ -33,7 +33,7 @@ abstract class SSH2
* Loads a signature * Loads a signature
* *
* @access public * @access public
* @param array $sig * @param string $sig
* @return mixed * @return mixed
*/ */
public static function load($sig) public static function load($sig)
@ -67,9 +67,9 @@ abstract class SSH2
*/ */
public static function save(BigInteger $r, BigInteger $s) public static function save(BigInteger $r, BigInteger $s)
{ {
if ($r->getLength() != 160 || $s->getLength() != 160) { if ($r->getLength() > 160 || $s->getLength() > 160) {
return false; return false;
} }
return Strings::packSSH2('ss', $r, $s); return Strings::packSSH2('ss', 'ssh-dss', $r->toBytes() . $s->toBytes());
} }
} }