From ed72f5c5b371013c39fd3438b67a9e4d55544507 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 23 Nov 2019 13:37:01 +0000 Subject: [PATCH] rsa: Introduce LDPUBFATAL Error handling, and thus the implementation, is going to change. So move bring it into a common place. No functional change. Signed-off-by: Ian Jackson --- rsa.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rsa.c b/rsa.c index 9261ab3..44b9b81 100644 --- a/rsa.c +++ b/rsa.c @@ -315,6 +315,9 @@ static void rsapub_dispose(void *sst) { #define RSAPUB_LOADCORE_DEFBN(ix,en,what) \ const char *en##s, struct cloc en##_loc, +#define LDPUBFATAL(enloc,...) \ + cfgfatal(enloc, "rsa-public", __VA_ARGS__) + static struct rsapub *rsa_loadpub_core(RSAPUB_BNS(RSAPUB_LOADCORE_DEFBN) struct cloc overall_loc) { @@ -336,11 +339,11 @@ static struct rsapub *rsa_loadpub_core(RSAPUB_BNS(RSAPUB_LOADCORE_DEFBN) #define RSAPUB_LOADCORE_GETBN(ix,en,what) \ if (mpz_init_set_str(&st->en,en##s,10)!=0) { \ - cfgfatal(en##_loc,"rsa-public", what " \"%s\" is not a " \ + LDPUBFATAL(en##_loc, what " \"%s\" is not a " \ "decimal number string\n",en##s); \ } \ if (mpz_sizeinbase(&st->en, 256) > RSA_MAX_MODBYTES) { \ - cfgfatal(en##_loc, "rsa-public", "implausibly large " what "\n"); \ + LDPUBFATAL(en##_loc, "implausibly large " what "\n"); \ } RSAPUB_BNS(RSAPUB_LOADCORE_GETBN) -- 2.30.2