]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Restore certificate stack push
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Thu, 5 Oct 2023 17:16:19 +0000 (11:16 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Fri, 6 Oct 2023 16:25:57 +0000 (10:25 -0600)
I had temporarily removed this code during the tree traversal review,
and forgot to restore it.

Push current certificate into certificate stack, so child objects can
validate themselves against it.

src/object/certificate.c

index 142547f863e5c06813d80d0dc9b0eb18fc9a9c86..523b159108310fb31ec7b539f6107b5e6015eb67 100644 (file)
@@ -2033,9 +2033,17 @@ certificate_traverse(struct rpp *rpp_parent, struct rpki_uri *cert_uri)
        if (error)
                goto revert_uris;
 
-       error = handle_manifest(sia_uris.mft, &pp);
+       error = x509stack_push(validation_certstack(state), cert_uri,
+                   cert, policy, certype);
        if (error)
                goto revert_uris;
+       cert = NULL; /* Ownership stolen */
+
+       error = handle_manifest(sia_uris.mft, &pp);
+       if (error) {
+               x509stack_cancel(validation_certstack(state));
+               goto revert_uris;
+       }
 
        /* -- Validate & traverse the RPP (@pp) described by the manifest -- */
        rpp_traverse(pp);