1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -05:00

Merged SSH1 robustness changes from 0.55 release branch on to trunk.

[originally from svn r4379]
This commit is contained in:
Simon Tatham
2004-08-01 12:07:11 +00:00
parent 29605a0719
commit 4217269931
8 changed files with 528 additions and 200 deletions

View File

@ -686,14 +686,26 @@ int main(int argc, char **argv)
if (!load_encrypted) {
void *vblob;
char *blob;
int n, bloblen;
int n, l, bloblen;
ret = rsakey_pubblob(&infilename, &vblob, &bloblen, &error);
blob = (char *)vblob;
n = 4; /* skip modulus bits */
n += ssh1_read_bignum(blob + n, &ssh1key->exponent);
n += ssh1_read_bignum(blob + n, &ssh1key->modulus);
l = ssh1_read_bignum(blob + n, bloblen - n,
&ssh1key->exponent);
if (l < 0) {
error = "SSH1 public key blob was too short";
} else {
n += l;
l = ssh1_read_bignum(blob + n, bloblen - n,
&ssh1key->modulus);
if (l < 0) {
error = "SSH1 public key blob was too short";
} else
n += l;
}
ssh1key->comment = NULL;
ssh1key->private_exponent = NULL;
} else {