]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Improve val_sigcrypt.c::algo_needs_missing for one loop pass.
authorGeorge Thessalonikefs <george@nlnetlabs.nl>
Sun, 3 Jul 2022 21:32:18 +0000 (23:32 +0200)
committerGeorge Thessalonikefs <george@nlnetlabs.nl>
Sun, 3 Jul 2022 21:32:18 +0000 (23:32 +0200)
doc/Changelog
validator/val_sigcrypt.c

index 4edeb6d3a7a9f9d5104039daf54c3d0232c87745..8568395fb8170c59e362d7a2d1308b86f68b9f38 100644 (file)
@@ -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.
index b4901f1aeedf15156a85e46c7daaddd2ae9b97d0..17d1b454576b130607423f7a122dbe8e83d06b70 100644 (file)
@@ -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; i<ALGO_NEEDS_MAX; i++)
                if(n->needs[i] == 2)
                        return 0;
-       /* now check which algo is missing */
-       for(i=0; i<ALGO_NEEDS_MAX; i++)
-               if(n->needs[i] == 1)
-                       return i;
+               if(n->needs[i] == 1 && miss == -1)
+                       miss = i;
+       if(miss != -1) return miss;
        return 0;
 }