From c513119bba5b7be83d22ed52a32ee4162eff0e1c Mon Sep 17 00:00:00 2001 From: George Thessalonikefs Date: Sun, 3 Jul 2022 23:32:18 +0200 Subject: [PATCH] - Improve val_sigcrypt.c::algo_needs_missing for one loop pass. --- doc/Changelog | 1 + validator/val_sigcrypt.c | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index 4edeb6d3a..8568395fb 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -5,6 +5,7 @@ - For #660: formatting, less verbose logging, add EDE information. - Fix for correct openssl error when adding windows CA certificates to the openssl trust store. + - Improve val_sigcrypt.c::algo_needs_missing for one loop pass. 1 July 2022: George - Merge PR #706: NXNS fallback. diff --git a/validator/val_sigcrypt.c b/validator/val_sigcrypt.c index b4901f1ae..17d1b4545 100644 --- a/validator/val_sigcrypt.c +++ b/validator/val_sigcrypt.c @@ -513,15 +513,16 @@ size_t algo_needs_num_missing(struct algo_needs* n) int algo_needs_missing(struct algo_needs* n) { - int i; - /* first check if a needed algo was bogus - report that */ + int i, miss = -1; + /* check if a needed algo was bogus - report that; + * check the first missing algo - report that; + * or return 0 */ for(i=0; ineeds[i] == 2) return 0; - /* now check which algo is missing */ - for(i=0; ineeds[i] == 1) - return i; + if(n->needs[i] == 1 && miss == -1) + miss = i; + if(miss != -1) return miss; return 0; } -- 2.47.3