1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00
putty-source/windows/utils
Simon Tatham c1a2114b28 Implement AES-GCM using the @openssh.com protocol IDs.
I only recently found out that OpenSSH defined their own protocol IDs
for AES-GCM, defined to work the same as the standard ones except that
they fixed the semantics for how you select the linked cipher+MAC pair
during key exchange.

(RFC 5647 defines protocol ids for AES-GCM in both the cipher and MAC
namespaces, and requires that you MUST select both or neither - but
this contradicts the selection policy set out in the base SSH RFCs,
and there's no discussion of how you resolve a conflict between them!
OpenSSH's answer is to do it the same way ChaCha20-Poly1305 works,
because that will ensure the two suites don't fight.)

People do occasionally ask us for this linked cipher/MAC pair, and now
I know it's actually feasible, I've implemented it, including a pair
of vector implementations for x86 and Arm using their respective
architecture extensions for multiplying polynomials over GF(2).

Unlike ChaCha20-Poly1305, I've kept the cipher and MAC implementations
in separate objects, with an arm's-length link between them that the
MAC uses when it needs to encrypt single cipher blocks to use as the
inputs to the MAC algorithm. That enables the cipher and the MAC to be
independently selected from their hardware-accelerated versions, just
in case someone runs on a system that has polynomial multiplication
instructions but not AES acceleration, or vice versa.

There's a fourth implementation of the GCM MAC, which is a pure
software implementation of the same algorithm used in the vectorised
versions. It's too slow to use live, but I've kept it in the code for
future testing needs, and because it's a convenient place to dump my
design comments.

The vectorised implementations are fairly crude as far as optimisation
goes. I'm sure serious x86 _or_ Arm optimisation engineers would look
at them and laugh. But GCM is a fast MAC compared to HMAC-SHA-256
(indeed compared to HMAC-anything-at-all), so it should at least be
good enough to use. And we've got a working version with some tests
now, so if someone else wants to improve them, they can.
2022-08-16 20:33:58 +01:00
..
agent_mutex_name.c Windows Pageant: make atomic client/server decision. 2022-01-03 12:21:39 +00:00
agent_named_pipe_name.c Move agent_named_pipe_name into its own source file. 2022-01-03 12:12:05 +00:00
arm_arch_queries.c Implement AES-GCM using the @openssh.com protocol IDs. 2022-08-16 20:33:58 +01:00
aux_match_opt.c Windows Pageant and PuTTYgen: spiff up option parsing. 2022-01-15 18:27:19 +00:00
centre_window.c Windows: utility function to centre a window. 2022-04-25 14:10:16 +01:00
cryptoapi.c
defaults.c
dll_hijacking_protection.c
dputs.c Windows dputs: use WriteFile to avoid stdio buffering. 2021-09-30 19:00:11 +01:00
escape_registry_key.c
filename.c
fontspec.c
get_system_dir.c Factor out Windows utility function get_system_dir(). 2021-05-08 17:18:17 +01:00
get_username.c
getdlgitemtext_alloc.c
interprocess_mutex.c Windows Pageant: turn 'has_security' into a global function. 2022-03-12 21:05:07 +00:00
is_console_handle.c
load_system32_dll.c Factor out Windows utility function get_system_dir(). 2021-05-08 17:18:17 +01:00
ltime.c
make_spr_sw_abort_winerror.c Richer data type for interactive prompt results. 2021-12-28 18:08:31 +00:00
makedlgitemborderless.c
message_box.c
minefield.c
open_for_write_would_lose_data.c Remove hard dependency on GetFileAttributesEx. 2022-03-12 18:51:21 +00:00
pgp_fingerprints_msgbox.c
platform_get_x_display.c
registry.c windows/storage.c: factor out low-level Registry access. 2022-04-24 08:38:27 +01:00
request_file.c
screenshot.c Windows tools: assorted '-demo' options. 2022-04-02 17:23:34 +01:00
security.c Formatting: standardise on "func(\n", not "func\n(". 2022-08-03 20:48:46 +01:00
shinydialogbox.c Move our DialogBox wrapper into windows/utils. 2022-04-25 14:10:16 +01:00
split_into_argv.c Generalise strbuf_catf() into put_fmt(). 2021-11-19 11:32:47 +00:00
strtoumax.c
version.c Make init_winver() idempotent. 2022-03-12 18:51:21 +00:00
win_strerror.c