mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-28 12:10:59 +00:00
DSA/Signature/SSH2: fix infrequent error with too short sigs
This commit is contained in:
parent
0074539429
commit
a96add4526
@ -70,6 +70,9 @@ abstract class SSH2
|
||||
if ($r->getLength() > 160 || $s->getLength() > 160) {
|
||||
return false;
|
||||
}
|
||||
return Strings::packSSH2('ss', 'ssh-dss', $r->toBytes() . $s->toBytes());
|
||||
return Strings::packSSH2('ss', 'ssh-dss',
|
||||
str_pad($r->toBytes(), 20, "\0", STR_PAD_LEFT) .
|
||||
str_pad($s->toBytes(), 20, "\0", STR_PAD_LEFT)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user