mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-15 19:16:55 +00:00
DSA/Signatures/SSH2: self generated signatures wouldn't verify
This commit is contained in:
parent
610d3d6ea0
commit
4a7d3d27ba
@ -33,7 +33,7 @@ abstract class SSH2
|
||||
* Loads a signature
|
||||
*
|
||||
* @access public
|
||||
* @param array $sig
|
||||
* @param string $sig
|
||||
* @return mixed
|
||||
*/
|
||||
public static function load($sig)
|
||||
@ -67,9 +67,9 @@ abstract class SSH2
|
||||
*/
|
||||
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 Strings::packSSH2('ss', $r, $s);
|
||||
return Strings::packSSH2('ss', 'ssh-dss', $r->toBytes() . $s->toBytes());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user