Skip to content

Commit

Permalink
Don't allow libopenarc to set an invalid chain status
Browse files Browse the repository at this point in the history
This is mainly an issue when a single administrative domain extends
the chain multiple times, e.g. on initial receipt and after an
internal modification of the message.

Fixes trusteddomainproject/OpenARC#169
  • Loading branch information
flowerysong committed Apr 10, 2024
1 parent 20df719 commit bbe5279
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libopenarc/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3115,6 +3115,10 @@ arc_set_cv(ARC_MESSAGE *msg, ARC_CHAIN cv)
cv == ARC_CHAIN_FAIL ||
cv == ARC_CHAIN_PASS);

/* none is only valid if there is no existing chain */
if ((cv == ARC_CHAIN_NONE) && (msg->arc_nsets != 0))
cv = ARC_CHAIN_PASS;

msg->arc_cstate = cv;
}

Expand Down

0 comments on commit bbe5279

Please sign in to comment.