]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Memorize notification URI before handling RRDP objects
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Wed, 4 Oct 2023 23:20:09 +0000 (17:20 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Wed, 4 Oct 2023 23:21:15 +0000 (17:21 -0600)
The URI is needed both by RRDP objects and Manifest; it seems I was not
taking the former into account.

src/rrdp/rrdp_loader.c

index 79d7c0454c207986f97dc176af5b0e13cc857ede..875da4fde56b78d63db106e54b6f78370bdfeccb 100644 (file)
@@ -58,6 +58,13 @@ rrdp_update(struct rpki_uri *uri)
        if (uri == NULL || !uri_is_https(uri))
                pr_crit("Wrong call, trying to parse a non HTTPS URI");
 
+       /*
+        * TODO (fine) this is dirty and error prone.
+        * Find a better way to deliver the notification URI to the RRDP objects
+        * and manifest.
+        */
+       validation_set_notification_uri(state_retrieve(), uri);
+
        fnstack_push_uri(uri);
        pr_val_debug("Processing notification.");
 
@@ -104,11 +111,6 @@ revert_notification:
        update_notification_destroy(&new);
 
 end:   notification_metadata_cleanup(&old);
-
-       /* TODO (fine) hideous function side effect; find a better way. */
-       if (!error)
-               validation_set_notification_uri(state_retrieve(), uri);
-
        fnstack_pop();
        return error;
 }