1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-13 00:57:33 -05:00

Clean up RSA and DSA host-key cache formatters.

These were both using the old-fashioned strategy of 'count up the
length first, then go back over the same data trying not to do
anything different', which these days I'm trying to replace with
strbufs.

Also, while I was in ssh.h, removed the prototype of rsasanitise()
which doesn't even exist any more.
This commit is contained in:
Simon Tatham
2018-12-31 13:45:48 +00:00
parent 5b0f32a100
commit 814665fb22
4 changed files with 39 additions and 87 deletions

View File

@ -222,10 +222,8 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl)
/*
* First format the key into a string.
*/
int len = rsastr_len(&s->hostkey);
char *fingerprint;
char *keystr = snewn(len, char);
rsastr_fmt(keystr, &s->hostkey);
char *keystr = rsastr_fmt(&s->hostkey);
fingerprint = rsa_ssh1_fingerprint(&s->hostkey);
/* First check against manually configured host keys. */