@@ -807,7 +807,7 @@ validate_authenticity(signed_video_t *self, bu_list_item_t *sei)
807
807
808
808
// Determine if this GOP is valid, but has missing information. This happens if we have detected
809
809
// missed BUs or if the GOP is incomplete.
810
- if (valid == SV_AUTH_RESULT_OK && (num_missed > 0 )) { // && verify_success)) {
810
+ if (valid == SV_AUTH_RESULT_OK && (num_missed > 0 )) {
811
811
valid = SV_AUTH_RESULT_OK_WITH_MISSING_INFO ;
812
812
DEBUG_LOG ("Successful validation, but detected missing Bitstream Units" );
813
813
}
@@ -1188,7 +1188,7 @@ maybe_validate_gop(signed_video_t *self, bu_info_t *bu)
1188
1188
// If this is the first arrived SEI, but could still not validate the authenticity, signal to
1189
1189
// the user that the Signed Video feature has been detected.
1190
1190
svrc_t status = SV_OK ;
1191
- if (validation_flags -> is_first_sei ) {
1191
+ if (validation_flags -> is_first_sei && bu -> is_sv_sei ) {
1192
1192
latest -> authenticity = SV_AUTH_RESULT_SIGNATURE_PRESENT ;
1193
1193
latest -> public_key_has_changed = false;
1194
1194
// Check if the data is golden. If it is, update the validation status accordingly.
@@ -1201,7 +1201,7 @@ maybe_validate_gop(signed_video_t *self, bu_info_t *bu)
1201
1201
latest -> number_of_pending_picture_nalus = bu_list_num_pending_items (bu_list );
1202
1202
status = bu_list_update_status (bu_list , true);
1203
1203
validation_flags -> has_auth_result = true;
1204
- validation_flags -> lost_start_of_gop = false;
1204
+ validation_flags -> is_first_sei = false;
1205
1205
}
1206
1206
return status ;
1207
1207
}
@@ -1225,6 +1225,8 @@ maybe_validate_gop(signed_video_t *self, bu_info_t *bu)
1225
1225
latest -> number_of_received_picture_nalus = 0 ;
1226
1226
latest -> number_of_pending_picture_nalus = -1 ;
1227
1227
latest -> public_key_has_changed = public_key_has_changed ;
1228
+ validation_flags -> num_invalid = 0 ;
1229
+ validation_flags -> lost_start_of_gop = false;
1228
1230
// Reset |in_validation|.
1229
1231
update_sei_in_validation (self , true, NULL , NULL );
1230
1232
}
@@ -1248,6 +1250,7 @@ maybe_validate_gop(signed_video_t *self, bu_info_t *bu)
1248
1250
// The flag |is_first_validation| is used to ignore the first validation if we start the
1249
1251
// validation in the middle of a stream. Now it is time to reset it.
1250
1252
validation_flags -> is_first_validation = !validation_flags -> signing_present ;
1253
+ validation_flags -> is_first_sei &= !bu -> is_sv_sei ;
1251
1254
1252
1255
if (validation_flags -> reset_first_validation ) {
1253
1256
validation_flags -> is_first_validation = true;
@@ -1491,7 +1494,7 @@ add_bitstream_unit(signed_video_t *self, const uint8_t *bu_data, size_t bu_data_
1491
1494
SV_THROW_IF (!self -> legacy_sv , SV_MEMORY );
1492
1495
sv_accumulated_validation_init (self -> accumulated_validation );
1493
1496
}
1494
- if (nalus_pending_registration && self -> validation_flags . hash_algo_known ) {
1497
+ if (nalus_pending_registration && validation_flags -> hash_algo_known ) {
1495
1498
SV_THROW (reregister_bu (self ));
1496
1499
}
1497
1500
SV_THROW (maybe_validate_gop (self , & bu ));
0 commit comments