mirror of
https://github.com/danog/phpseclib.git
synced 2024-11-27 12:55:58 +01: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