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

Utility functions to get the algorithm from a public key.

Every time I've had to do this before, I've always done the three-line
dance of initialising a BinarySource and calling get_string on it.
It's long past time I wrapped that up into a convenient subroutine.
This commit is contained in:
Simon Tatham
2022-04-21 11:00:16 +01:00
parent e7d51505c7
commit a5c0205b87
5 changed files with 21 additions and 11 deletions

View File

@ -353,10 +353,8 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl)
/* Also, extract the algorithm string from the start
* of the public-key blob. */
BinarySource src[1];
BinarySource_BARE_INIT_PL(src, ptrlen_from_strbuf(
s->agent_keys[i].blob));
s->agent_keys[i].algorithm = get_string(src);
s->agent_keys[i].algorithm = pubkey_blob_to_alg_name(
ptrlen_from_strbuf(s->agent_keys[i].blob));
}
ppl_logevent("Pageant has %"SIZEu" SSH-2 keys", nkeys);