mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-19 03:51:02 -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:
5
cmdgen.c
5
cmdgen.c
@ -1280,9 +1280,8 @@ int main(int argc, char **argv)
|
||||
} else {
|
||||
assert(ssh2blob);
|
||||
|
||||
BinarySource src[1];
|
||||
BinarySource_BARE_INIT_PL(src, ptrlen_from_strbuf(ssh2blob));
|
||||
ptrlen algname = get_string(src);
|
||||
ptrlen algname = pubkey_blob_to_alg_name(
|
||||
ptrlen_from_strbuf(ssh2blob));
|
||||
const ssh_keyalg *alg = find_pubkey_alg_len(algname);
|
||||
if (!alg) {
|
||||
fprintf(stderr, "puttygen: cannot extract key components "
|
||||
|
Reference in New Issue
Block a user