Commit a497828
committed
Allow RSA signatures with length less than the modulus size
PuTTY < 0.82 does not pad signature blobs with SHA2. See commit
a5bcf3d384e [1].
Additionally, contrary to rsa-sha2-256 and rsa-sha2-512, the
specification for the original ssh-rsa signatures seems to require
no padding, even though openssh always pads with zeros:
> The value for 'rsa_signature_blob' is encoded as a string containing
> s (which is an integer, without lengths or padding, unsigned, and
> in network byte order).
For compatibility with these implementations, zero pad the signature
if it is smaller than the modulus size.
[1] https://git.tartarus.org/?p=simon/putty.git;a=commit;h=a5bcf3d384e1bf15a51a6923c3724cbbee022d8e1 parent ed605a6 commit a497828
1 file changed
+17
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
513 | | - | |
| 513 | + | |
514 | 514 | | |
515 | 515 | | |
| 516 | + | |
516 | 517 | | |
517 | 518 | | |
518 | 519 | | |
| |||
555 | 556 | | |
556 | 557 | | |
557 | 558 | | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
558 | 572 | | |
559 | 573 | | |
560 | 574 | | |
| |||
563 | 577 | | |
564 | 578 | | |
565 | 579 | | |
566 | | - | |
| 580 | + | |
567 | 581 | | |
568 | 582 | | |
569 | 583 | | |
| |||
573 | 587 | | |
574 | 588 | | |
575 | 589 | | |
| 590 | + | |
576 | 591 | | |
577 | 592 | | |
578 | 593 | | |
| |||
0 commit comments