1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-16 02:27:32 -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

3
ssh.h
View File

@ -1331,6 +1331,9 @@ extern const size_t n_keyalgs;
const ssh_keyalg *find_pubkey_alg(const char *name);
const ssh_keyalg *find_pubkey_alg_len(ptrlen name);
ptrlen pubkey_blob_to_alg_name(ptrlen blob);
const ssh_keyalg *pubkey_blob_to_alg(ptrlen blob);
/* Convenient wrappers on the LoadedFile mechanism suitable for key files */
LoadedFile *lf_load_keyfile(const Filename *filename, const char **errptr);
LoadedFile *lf_load_keyfile_fp(FILE *fp, const char **errptr);