From 6b39be88d812022a7da04b39faaa60a84ccbaddd Mon Sep 17 00:00:00 2001 From: shunf4 Date: Thu, 28 Apr 2022 23:19:18 +0800 Subject: [PATCH] Raise AGENT_MAX_MSGLEN to 256Kb That's the same value as in the OpenSSH source code, (https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/ssh-agent.c?rev=1.287&content-type=text/x-cvsweb-markup#:~:text=AGENT_MAX_LEN) so it should be large enough that anyone needing to sign a larger message will have other problems too. --- winpgntc.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/winpgntc.h b/winpgntc.h index f388c29..0569e85 100644 --- a/winpgntc.h +++ b/winpgntc.h @@ -13,7 +13,13 @@ #include -#define AGENT_MAX_MSGLEN 8192 +/* OpenSSH uses the same size value: + * https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/ssh-agent.c?rev=1.287&content-type=text/x-cvsweb-markup#:~:text=AGENT_MAX_LEN + * + * 4 is for the 4 bytes message length field added before the agent + * message. + */ +#define AGENT_MAX_MSGLEN ((256*1024)+4) #if defined(__MSYS__) && !defined(__NEWLIB__) // MSYS doesn't have stdint.h or uint32_t,