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

New key component type KCT_BINARY.

This stores its data in the same format as the existing KCT_TEXT, but
it displays differently in puttygen --dump, expecting that the data
will be full of horrible control characters, invalid UTF-8, etc.

The displayed data is of the form b64("..."), so you get a hint about
what the encoding is, and can still paste into Python by defining the
identifier 'b64' to be base64.b64decode or equivalent.
This commit is contained in:
Simon Tatham
2022-04-18 10:06:31 +01:00
parent 68514ac8a1
commit 62bc6c5448
4 changed files with 55 additions and 7 deletions

View File

@ -1231,7 +1231,8 @@ strbuf *key_components_nth_str(key_components *kc, size_t n)
{
if (n >= kc->ncomponents)
return NULL;
if (kc->components[n].type != KCT_TEXT)
if (kc->components[n].type != KCT_TEXT &&
kc->components[n].type != KCT_BINARY)
return NULL;
return strbuf_dup(ptrlen_from_strbuf(kc->components[n].str));
}