Skip to content

Commit

Permalink
Keeps public key failure through while loop (#273)
Browse files Browse the repository at this point in the history
Co-authored-by: bjornvolcker <[email protected]>
  • Loading branch information
bjornvolcker and bjornvolcker authored Dec 13, 2024
1 parent e06c54f commit 20345e5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/src/signed_video_h26x_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,7 @@ maybe_validate_gop(signed_video_t *self, h26x_nalu_t *nalu)

svrc_t status = SV_UNKNOWN_FAILURE;
SV_TRY()
bool public_key_has_changed = false;
char sei_validation_status = 'U';
// Keep validating as long as there are pending GOPs.
bool stop_validating = false;
Expand All @@ -1057,6 +1058,7 @@ maybe_validate_gop(signed_video_t *self, h26x_nalu_t *nalu)
latest->number_of_expected_picture_nalus = 0;
latest->number_of_received_picture_nalus = 0;
latest->number_of_pending_picture_nalus = -1;
latest->public_key_has_changed = public_key_has_changed;
}
if (validation_flags->is_first_validation) {
// Reset in_validation.
Expand Down Expand Up @@ -1088,6 +1090,7 @@ maybe_validate_gop(signed_video_t *self, h26x_nalu_t *nalu)

self->gop_info->verified_signature_hash = -1;
self->validation_flags.has_auth_result = true;
public_key_has_changed |= latest->public_key_has_changed; // Pass on public key failure.

if (validation_flags->is_first_validation) {
// Reset any set linked hashes if the session is still waiting for a first validation.
Expand Down

0 comments on commit 20345e5

Please sign in to comment.