mirror of
https://github.com/danog/phpseclib.git
synced 2025-01-22 13:01:59 +01: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
|
* 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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user