From dbe92ee61c95e934908811b9666b656e5ed1ae33 Mon Sep 17 00:00:00 2001 From: bjornvolcker Date: Wed, 6 Aug 2025 09:50:41 +0200 Subject: [PATCH] Moves vendors into src Since this repository has become Axis vendor only there is no longer a need to separate it from the normal source code. This commit moves the two files into src/ and removes the meson option 'vendors'. --- README.md | 24 ++++++++----------- lib/README.md | 19 ++++----------- lib/meson.build | 1 - lib/src/legacy/legacy_auth.c | 9 ++----- lib/src/legacy/legacy_common.c | 2 -- lib/src/legacy/legacy_tlv.c | 15 +----------- lib/src/meson.build | 8 +++---- lib/src/sv_auth.c | 8 +------ .../sv_axis_communications.c} | 5 ++-- .../sv_axis_communications_internal.h} | 0 lib/src/sv_common.c | 8 +------ lib/src/sv_sign.c | 6 +---- lib/src/sv_tlv.c | 22 +---------------- lib/vendors/README.md | 13 ---------- lib/vendors/axis-communications/meson.build | 4 ---- lib/vendors/meson.build | 7 ------ meson.build | 7 +----- meson_options.txt | 5 ---- tests/check/check_signed_video_auth.c | 8 ------- tests/check/check_signed_video_sign.c | 8 ------- tests/test_checks.sh | 8 +------ 21 files changed, 29 insertions(+), 158 deletions(-) rename lib/{vendors/axis-communications/sv_vendor_axis_communications.c => src/sv_axis_communications.c} (99%) rename lib/{vendors/axis-communications/sv_vendor_axis_communications_internal.h => src/sv_axis_communications_internal.h} (100%) delete mode 100644 lib/vendors/README.md delete mode 100644 lib/vendors/axis-communications/meson.build delete mode 100644 lib/vendors/meson.build diff --git a/README.md b/README.md index c37dece4..ae84087a 100644 --- a/README.md +++ b/README.md @@ -14,30 +14,26 @@ signed-video-framework | | | └── plugin.c | | └── unthreaded-signing | | └── plugin.c -| ├── src -| | ├── includes -| | | └── public header files -| | └── source files -| └── vendors -| └── axis-communications -| └── source files +| └── src +| ├── includes +| | └── public header files +| └── source files └── tests ``` The repository is split into a library and tests. The library is further organized in -[source code](./lib/src/), [plugins](./lib/plugins/) and [vendors](./lib/vendors/). The source code -includes all necessary source files for both signing and validation, and there is no conceptual -difference in building the library for signing or for validation. +[source code](./lib/src/) and [plugins](./lib/plugins/). The source code includes all necessary +source files for both signing and validation, and there is no conceptual difference in building the +library for signing or for validation. Signing is commonly device specific with separate calls for, e.g., reading and using private keys. Therefore, the framework uses the concept of signing plugins which implements a set of [interfaces](./lib/src/includes/signed_video_signing_plugin.h). The framework comes with both a threaded and an unthreaded signing plugin. -Further, the framework allows for vendor specific metadata. Adding that on the signing side, and -interpreting it on the validation side is controlled through vendor specific code. - -For instructions on how to use the APIs to integrate the Signed Video Framework in either a signing or a validation application, see [lib/](./lib/). Example applications are available in the [signed-video-framework-examples](https://github.com/AxisCommunications/signed-video-framework-examples) repository. +For instructions on how to use the APIs to integrate the Signed Video Framework in either a signing +or a validation application, see [lib/](./lib/). Example applications are available in the +[signed-video-framework-examples](https://github.com/AxisCommunications/signed-video-framework-examples) repository. # Releases There are no pre-built releases. The user is encouraged to build the library from a [release tag](https://github.com/AxisCommunications/signed-video-framework/tags). diff --git a/lib/README.md b/lib/README.md index c210b2aa..1b74c304 100644 --- a/lib/README.md +++ b/lib/README.md @@ -8,16 +8,13 @@ lib | | └── plugin.c | └── unthreaded-signing | └── plugin.c -├── src -| ├── includes -| | └── public header files -| └── source files -└── vendors - └── axis-communications - └── source files +└── src + ├── includes + | └── public header files + └── source files ``` -The library is organized in [source code](./src/), [plugins](./plugins/) and [vendors](./vendors/). +The library is organized in [source code](./src/) and [plugins](./plugins/). The source code includes all necessary source files for both signing and validation, and there is no conceptual difference in building the library for signing or for validation. @@ -26,9 +23,3 @@ plugin. The interfaces can be found in [signed_video_signing_plugin.h](./src/includes/signed_video_signing_plugin.h). The framework comes with both a threaded and an unthreaded signing plugin. When building the library with the meson structure in this repository, the library includes that plugin. - -Vendor specific code and APIs are typically handling extra metadata added to the SEI/OBU Metadata, -which needs to be interpreted correctly when validating authenticity. With the meson option `vendor` -the user can select which vendor(s) to include in the build. Typically, when building for signing -the vendor for that camera is selected, whereas when building for validation all vendors are -included. By default, all vendors are added. diff --git a/lib/meson.build b/lib/meson.build index 30a20bf4..f778a8c5 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -1,4 +1,3 @@ # Process plugins first to get the plugin sources used in src/ subdir('plugins') -subdir('vendors') subdir('src') diff --git a/lib/src/legacy/legacy_auth.c b/lib/src/legacy/legacy_auth.c index e6070508..67e26750 100644 --- a/lib/src/legacy/legacy_auth.c +++ b/lib/src/legacy/legacy_auth.c @@ -22,15 +22,12 @@ #include #include // strcmp -#include "legacy_validation.h" // Has public declarations - -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS -#include "axis-communications/sv_vendor_axis_communications_internal.h" -#endif #include "legacy/legacy_bu_list.h" #include "legacy/legacy_internal.h" #include "legacy/legacy_tlv.h" // legacy_tlv_decode() +#include "legacy_validation.h" // Has public declarations #include "sv_authenticity.h" // update_accumulated_validation() +#include "sv_axis_communications_internal.h" #include "sv_openssl_internal.h" // sv_openssl_verify_hash() #include "sv_tlv.h" // sv_tlv_find_tag() @@ -754,7 +751,6 @@ legacy_prepare_for_validation(legacy_sv_t *self) SV_THROW_IF_WITH_MSG(validation_flags->signing_present && !self->has_public_key, SV_NOT_SUPPORTED, "No public key present"); -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS // If "Axis Communications AB" can be identified from the |product_info|, get // |supplemental_authenticity| from |vendor_handle|. if (sei && strcmp(self->product_info->manufacturer, "Axis Communications AB") == 0) { @@ -780,7 +776,6 @@ legacy_prepare_for_validation(legacy_sv_t *self) } } } -#endif // If we have received a SEI there is a signature to use for verification. if (self->gop_state.has_sei || self->bu_list->first_item->bu->is_golden_sei) { diff --git a/lib/src/legacy/legacy_common.c b/lib/src/legacy/legacy_common.c index 9bbff611..5deda228 100644 --- a/lib/src/legacy/legacy_common.c +++ b/lib/src/legacy/legacy_common.c @@ -979,10 +979,8 @@ legacy_sv_create(signed_video_t *parent) SV_THROW_WITH_MSG(legacy_reset_gop_hash(self), "Could not reset gop_hash"); // Borrow vendor handle from |parent|. -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS self->vendor_handle = parent->vendor_handle; SV_THROW_IF(!self->vendor_handle, SV_MEMORY); -#endif // Initialize validation members self->bu_list = legacy_bu_list_create(); diff --git a/lib/src/legacy/legacy_tlv.c b/lib/src/legacy/legacy_tlv.c index 3912c3dc..3b5b58b8 100644 --- a/lib/src/legacy/legacy_tlv.c +++ b/lib/src/legacy/legacy_tlv.c @@ -25,12 +25,10 @@ #endif #include -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS -#include "axis-communications/sv_vendor_axis_communications_internal.h" -#endif #include "includes/signed_video_common.h" // Return codes #include "includes/signed_video_openssl.h" // sign_or_verify_data_t #include "sv_authenticity.h" // allocate_memory_and_copy_string, transfer_product_info() +#include "sv_axis_communications_internal.h" #include "sv_openssl_internal.h" // openssl_public_key_malloc() #include "sv_tlv.h" // sv_read_8bits, sv_read_16bits, sv_read_32bits, sv_read_64bits_signed @@ -382,7 +380,6 @@ legacy_decode_public_key(legacy_sv_t *self, const uint8_t *data, size_t data_siz // Convert to EVP_PKEY_CTX SV_THROW(openssl_public_key_malloc(self->verify_data, &self->pem_public_key)); -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS // If "Axis Communications AB" can be identified from the |product_info|, set |public_key| to // |vendor_handle|. if (strcmp(self->product_info->manufacturer, "Axis Communications AB") == 0) { @@ -390,7 +387,6 @@ legacy_decode_public_key(legacy_sv_t *self, const uint8_t *data, size_t data_siz SV_THROW(set_axis_communications_public_key(self->vendor_handle, self->verify_data->key, self->latest_validation->public_key_has_changed)); } -#endif SV_THROW_IF(data_ptr != data + data_size, SV_AUTHENTICATION_ERROR); #ifdef PRINT_DECODED_SEI @@ -549,18 +545,9 @@ legacy_decode_crypto_info(legacy_sv_t *self, const uint8_t *data, size_t data_si * */ static svrc_t -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS legacy_decode_axis_communications(legacy_sv_t *self, const uint8_t *data, size_t data_size) { return decode_axis_communications_handle(self->vendor_handle, data, data_size); -#else -legacy_decode_axis_communications(legacy_sv_t ATTR_UNUSED *self, - const uint8_t ATTR_UNUSED *data, - size_t ATTR_UNUSED data_size) -{ - // Vendor Axis Communications not selected. - return SV_NOT_SUPPORTED; -#endif } static svrc_t diff --git a/lib/src/meson.build b/lib/src/meson.build index 46f04a2c..9e481720 100644 --- a/lib/src/meson.build +++ b/lib/src/meson.build @@ -5,6 +5,7 @@ signedvideoframework_public_headers = files( 'includes/signed_video_openssl.h', 'includes/signed_video_sign.h', 'includes/signed_video_signing_plugin.h', + 'includes/sv_vendor_axis_communications.h' ) signedvideoframework_sources = files( @@ -12,6 +13,8 @@ signedvideoframework_sources = files( 'sv_auth.c', 'sv_authenticity.c', 'sv_authenticity.h', + 'sv_axis_communications.c', + 'sv_axis_communications_internal.h', 'sv_bu_list.c', 'sv_bu_list.h', 'sv_codec_av1.c', @@ -41,13 +44,8 @@ legacy_sources = files( # Add source files from plugins, vendors, legacy code signedvideoframework_sources += plugin_sources -signedvideoframework_sources += vendor_sources signedvideoframework_sources += legacy_sources -# Add vendor specific public headers -if build_with_axis - signedvideoframework_public_headers += files('includes/sv_vendor_axis_communications.h') -endif # Add ONVIF Media Signing source files and public headers if populated_media_signing_submodule signedvideoframework_sources += mediasigningframework_sources diff --git a/lib/src/sv_auth.c b/lib/src/sv_auth.c index f7c76dbe..80430f19 100644 --- a/lib/src/sv_auth.c +++ b/lib/src/sv_auth.c @@ -21,13 +21,11 @@ #include // assert #include // free -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS -#include "axis-communications/sv_vendor_axis_communications_internal.h" -#endif #include "includes/signed_video_auth.h" #include "includes/signed_video_openssl.h" // pem_pkey_t, sign_or_verify_data_t #include "legacy_validation.h" #include "sv_authenticity.h" // sv_create_local_authenticity_report_if_needed() +#include "sv_axis_communications_internal.h" #include "sv_bu_list.h" // bu_list_append() #include "sv_defines.h" // svrc_t #include "sv_internal.h" // gop_info_t, validation_flags_t @@ -987,7 +985,6 @@ prepare_for_validation(signed_video_t *self, bu_list_item_t **sei) } validation_flags->waiting_for_signature = !(*sei)->bu->is_signed; -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS // If "Axis Communications AB" can be identified from the |product_info|, get // |supplemental_authenticity| from |vendor_handle|. if (strcmp(self->product_info.manufacturer, "Axis Communications AB") == 0) { @@ -1013,7 +1010,6 @@ prepare_for_validation(signed_video_t *self, bu_list_item_t **sei) } } } -#endif SV_CATCH() SV_DONE(status) @@ -1410,11 +1406,9 @@ detect_onvif_media_signing(signed_video_t *self, const bu_info_t *bu) SV_TRY() self->onvif = onvif_media_signing_create(codec); SV_THROW_IF(!self->onvif, SV_EXTERNAL_ERROR); -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS // Get the root CA certificate from Axis code. trusted_certificate = get_axis_communications_trusted_certificate(); trusted_certificate_size = strlen(trusted_certificate); -#endif SV_THROW(msrc_to_svrc(onvif_media_signing_set_trusted_certificate( self->onvif, trusted_certificate, trusted_certificate_size, false))); // If the ONVIF Media Signing session has successfully been set up, register all diff --git a/lib/vendors/axis-communications/sv_vendor_axis_communications.c b/lib/src/sv_axis_communications.c similarity index 99% rename from lib/vendors/axis-communications/sv_vendor_axis_communications.c rename to lib/src/sv_axis_communications.c index c155c807..748bbf7c 100644 --- a/lib/vendors/axis-communications/sv_vendor_axis_communications.c +++ b/lib/src/sv_axis_communications.c @@ -18,8 +18,6 @@ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "includes/sv_vendor_axis_communications.h" - #include #include // BIO_* #include // EVP_* @@ -29,9 +27,10 @@ #include #include // malloc, memcpy, calloc, free +#include "includes/sv_vendor_axis_communications.h" +#include "sv_axis_communications_internal.h" #include "sv_internal.h" // signed_video_t #include "sv_tlv.h" -#include "sv_vendor_axis_communications_internal.h" #define NUM_UNTRUSTED_CERTIFICATES 2 // |certificate_chain| has 2 untrusted certificates. #define CHIP_ID_SIZE 18 diff --git a/lib/vendors/axis-communications/sv_vendor_axis_communications_internal.h b/lib/src/sv_axis_communications_internal.h similarity index 100% rename from lib/vendors/axis-communications/sv_vendor_axis_communications_internal.h rename to lib/src/sv_axis_communications_internal.h diff --git a/lib/src/sv_common.c b/lib/src/sv_common.c index 74718436..95950a0a 100644 --- a/lib/src/sv_common.c +++ b/lib/src/sv_common.c @@ -28,14 +28,12 @@ #include // free, calloc, malloc #include // size_t -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS -#include "axis-communications/sv_vendor_axis_communications_internal.h" -#endif #include "includes/signed_video_common.h" #include "includes/signed_video_helpers.h" // onvif_media_signing_parse_sei() #include "includes/signed_video_openssl.h" // pem_pkey_t, sign_or_verify_data_t #include "includes/signed_video_signing_plugin.h" #include "sv_authenticity.h" // sv_latest_validation_init() +#include "sv_axis_communications_internal.h" #include "sv_bu_list.h" // bu_list_create(), bu_list_free() #include "sv_codec_internal.h" // parse_h264_nalu_header(), parse_av1_obu_header() #include "sv_defines.h" // svrc_t @@ -990,10 +988,8 @@ signed_video_create(SignedVideoCodec codec) SV_THROW_IF_WITH_MSG(!self->gop_info, SV_MEMORY, "Could not allocate gop_info"); self->gop_info->num_in_partial_gop = 0; // Setup vendor handle. -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS self->vendor_handle = sv_vendor_axis_communications_setup(); SV_THROW_IF(!self->vendor_handle, SV_MEMORY); -#endif // Initialize signing members // Signing plugin is setup when the private key is set. @@ -1091,9 +1087,7 @@ signed_video_free(signed_video_t *self) // Teardown the plugin before closing. sv_signing_plugin_session_teardown(self->plugin_handle); // Teardown the vendor handle. -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS sv_vendor_axis_communications_teardown(self->vendor_handle); -#endif // Teardown the crypto handle. sv_openssl_free_handle(self->crypto_handle); diff --git a/lib/src/sv_sign.c b/lib/src/sv_sign.c index 3734a553..105f5c9c 100644 --- a/lib/src/sv_sign.c +++ b/lib/src/sv_sign.c @@ -23,13 +23,11 @@ #include // free, malloc #include // size_t, strncpy -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS -#include "axis-communications/sv_vendor_axis_communications_internal.h" -#endif #include "includes/signed_video_openssl.h" // pem_pkey_t #include "includes/signed_video_sign.h" #include "includes/signed_video_signing_plugin.h" #include "sv_authenticity.h" // allocate_memory_and_copy_string +#include "sv_axis_communications_internal.h" #include "sv_codec_internal.h" // METADATA_TYPE_USER_PRIVATE #include "sv_defines.h" // svrc_t, sv_tlv_tag_t #include "sv_internal.h" // gop_info_t @@ -798,11 +796,9 @@ initialize_onvif(signed_video_t *self) SV_TRY() // Port settings to ONVIF SV_THROW(port_settings_to_onvif(self)); -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS // Retrieve the certificate chain certificate_chain = get_axis_communications_certificate_chain(self->vendor_handle); SV_THROW_IF(!certificate_chain, SV_MEMORY); -#endif // Set the signing key pair for ONVIF media signing SV_THROW(msrc_to_svrc(onvif_media_signing_set_signing_key_pair(self->onvif, self->private_key, self->private_key_size, certificate_chain, strlen(certificate_chain), false))); diff --git a/lib/src/sv_tlv.c b/lib/src/sv_tlv.c index 096b78e0..80fe045c 100644 --- a/lib/src/sv_tlv.c +++ b/lib/src/sv_tlv.c @@ -24,12 +24,10 @@ #include #endif -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS -#include "axis-communications/sv_vendor_axis_communications_internal.h" -#endif #include "includes/signed_video_auth.h" // signed_video_product_info_t #include "includes/signed_video_openssl.h" // pem_pkey_t, sign_or_verify_data_t #include "sv_authenticity.h" // transfer_product_info() +#include "sv_axis_communications_internal.h" #include "sv_openssl_internal.h" // openssl_public_key_malloc() /** @@ -714,7 +712,6 @@ decode_public_key(signed_video_t *self, const uint8_t *data, size_t data_size) // Convert to EVP_PKEY_CTX SV_THROW(openssl_public_key_malloc(self->verify_data, &self->pem_public_key)); -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS // If "Axis Communications AB" can be identified from the |product_info|, set |public_key| to // |vendor_handle|. if (strcmp(self->product_info.manufacturer, "Axis Communications AB") == 0) { @@ -722,7 +719,6 @@ decode_public_key(signed_video_t *self, const uint8_t *data, size_t data_size) SV_THROW(set_axis_communications_public_key(self->vendor_handle, self->verify_data->key, self->latest_validation->public_key_has_changed)); } -#endif SV_THROW_IF(data_ptr != data + data_size, SV_AUTHENTICATION_ERROR); #ifdef PRINT_DECODED_SEI @@ -1017,17 +1013,10 @@ decode_crypto_info(signed_video_t *self, const uint8_t *data, size_t data_size) * */ static size_t -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS encode_axis_communications(signed_video_t *self, uint8_t *data) { bool epb = self->sei_epb; return encode_axis_communications_handle(self->vendor_handle, &self->last_two_bytes, epb, data); -#else -encode_axis_communications(signed_video_t ATTR_UNUSED *self, uint8_t ATTR_UNUSED *data) -{ - // Vendor Axis Communications not selected. - return 0; -#endif } /** @@ -1035,7 +1024,6 @@ encode_axis_communications(signed_video_t ATTR_UNUSED *self, uint8_t ATTR_UNUSED * */ static svrc_t -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS decode_axis_communications(signed_video_t *self, const uint8_t *data, size_t data_size) { svrc_t status = SV_UNKNOWN_FAILURE; @@ -1051,14 +1039,6 @@ decode_axis_communications(signed_video_t *self, const uint8_t *data, size_t dat SV_DONE(status) return status; -#else -decode_axis_communications(signed_video_t ATTR_UNUSED *self, - const uint8_t ATTR_UNUSED *data, - size_t ATTR_UNUSED data_size) -{ - // Vendor Axis Communications not selected. - return SV_NOT_SUPPORTED; -#endif } static size_t diff --git a/lib/vendors/README.md b/lib/vendors/README.md deleted file mode 100644 index 7a931c15..00000000 --- a/lib/vendors/README.md +++ /dev/null @@ -1,13 +0,0 @@ -*Copyright (C) 2022, Axis Communications AB, Lund, Sweden. All Rights Reserved.* - -# Using vendor specific operations -It is necessary for the Signed Video Framework to handle vendor specific metadata. For example, -when adding the public key to the stream, validating the public key, in addition to validating the -video, is necessary. Such process will vary from vendor to vendor. - -Each vendor has a subfolder. API and file naming should follow the style `sv_vendor_`. - -Public API declarations necessary on the signing and/or the validation side are located in -[lib/src/includes/](../src/includes/). - -For an example, see code in [axis-communications/](./axis-communications/). diff --git a/lib/vendors/axis-communications/meson.build b/lib/vendors/axis-communications/meson.build deleted file mode 100644 index 36c44a03..00000000 --- a/lib/vendors/axis-communications/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -vendor_sources = files( - 'sv_vendor_axis_communications.c', - 'sv_vendor_axis_communications_internal.h', -) diff --git a/lib/vendors/meson.build b/lib/vendors/meson.build deleted file mode 100644 index 37fff1ac..00000000 --- a/lib/vendors/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -vendor_sources = [] -vendorinc = include_directories('.') - -if build_with_axis - message('build with axis-communications') - subdir('axis-communications') -endif diff --git a/meson.build b/meson.build index a2411705..f17c30d6 100644 --- a/meson.build +++ b/meson.build @@ -41,11 +41,6 @@ if get_option('generatetestkeys') add_global_arguments('-DGENERATE_TEST_KEYS', language : 'c') endif -build_with_axis = ('axis-communications' in get_option('vendors')) or ('all' in get_option('vendors')) -if build_with_axis - add_global_arguments('-DSV_VENDOR_AXIS_COMMUNICATIONS', language : 'c') -endif - signing_plugin = get_option('signingplugin') # Determine if 'threaded_unless_check_dep' should use 'threaded' or 'unthreaded' if (signing_plugin == 'threaded_unless_check_dep' and check_dep.found()) @@ -82,7 +77,7 @@ signedvideoframework_deps = [ openssl_dep, plugin_deps, mediasigningframework_de signedvideoframework = shared_library( 'signed-video-framework', signedvideoframework_sources, - include_directories : [ svsrcinc, vendorinc, omssrcinc ], + include_directories : [ svsrcinc, omssrcinc ], version : meson.project_version(), dependencies : signedvideoframework_deps, install : true, diff --git a/meson_options.txt b/meson_options.txt index 5fc1b385..1aee7bea 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -6,11 +6,6 @@ option('signingplugin', type : 'string', value : 'unthreaded', description : 'Select signing plugin; \'unthreaded\' (default), \'threaded\' or \'threaded_unless_check_dep\'') -option('vendors', - type : 'array', - choices : [ 'all', 'axis-communications' ], - value : [ 'all' ], - description : 'Select vendor(s) to support. By default all vendors are added. Set an empty list \'-Dvendors=\' if the library should be built without vendors.') option('parsesei', type : 'boolean', value : false, diff --git a/tests/check/check_signed_video_auth.c b/tests/check/check_signed_video_auth.c index f64a1560..1aa4a9e3 100644 --- a/tests/check/check_signed_video_auth.c +++ b/tests/check/check_signed_video_auth.c @@ -27,9 +27,7 @@ #include "includes/signed_video_common.h" // signed_video_t #include "includes/signed_video_openssl.h" // pem_pkey_t #include "includes/signed_video_sign.h" // signed_video_set_authenticity_level() -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS #include "includes/sv_vendor_axis_communications.h" -#endif #include "sv_internal.h" // set_hash_list_size() #include "sv_openssl_internal.h" // openssl_read_pubkey_from_private_key() #include "sv_tlv.h" // sv_write_byte_many() @@ -1572,7 +1570,6 @@ START_TEST(fallback_to_gop_level) } END_TEST -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS /* Test description * APIs in vendors/axis-communications are used and tests both signing and validation parts. */ START_TEST(vendor_axis_communications_operation) @@ -1839,7 +1836,6 @@ START_TEST(onvif_intact_stream) test_stream_free(list); } END_TEST -#endif static signed_video_t * generate_and_set_private_key_on_camera_side(struct sv_setting setting, @@ -2117,7 +2113,6 @@ START_TEST(no_emulation_prevention_bytes) signed_video_t *sv = get_initialized_signed_video(setting, false); ck_assert(sv); -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS const size_t attestation_size = 2; void *attestation = calloc(1, attestation_size); // Setting |attestation| and |certificate_chain|. @@ -2125,7 +2120,6 @@ START_TEST(no_emulation_prevention_bytes) sv, attestation, attestation_size, axisDummyCertificateChain); ck_assert_int_eq(sv_rc, SV_OK); free(attestation); -#endif // Add I-frame for signing and get SEI frame. sv_rc = signed_video_add_nalu_for_signing_with_timestamp( @@ -3296,11 +3290,9 @@ signed_video_suite(void) tcase_add_loop_test(tc, no_public_key_in_sei_and_bad_public_key_on_validation_side, s, e); tcase_add_loop_test(tc, fallback_to_gop_level, s, e); tcase_add_loop_test(tc, golden_sei_principle, s, e); -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS tcase_add_loop_test(tc, vendor_axis_communications_operation, s, e); tcase_add_loop_test(tc, factory_provisioned_key, s, e); tcase_add_loop_test(tc, onvif_intact_stream, s, e); -#endif tcase_add_loop_test(tc, no_emulation_prevention_bytes, s, e); tcase_add_loop_test(tc, with_blocked_signing, s, e); // Signed partial GOPs diff --git a/tests/check/check_signed_video_sign.c b/tests/check/check_signed_video_sign.c index ef33557f..3500f365 100644 --- a/tests/check/check_signed_video_sign.c +++ b/tests/check/check_signed_video_sign.c @@ -29,9 +29,7 @@ #include "includes/signed_video_common.h" #include "includes/signed_video_helpers.h" #include "includes/signed_video_sign.h" -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS #include "includes/sv_vendor_axis_communications.h" -#endif #include "sv_codec_internal.h" // bu_info_t, kUuidSignedVideo #include "sv_internal.h" // set_hash_list_size(), UUID_LEN #include "sv_tlv.h" // tlv_has_{optional, mandatory}_tags() @@ -411,7 +409,6 @@ START_TEST(incorrect_operation) } END_TEST -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS /* Test description * All APIs in vendors/axis-communications are checked for invalid parameters, and valid NULL * pointer inputs. */ @@ -509,7 +506,6 @@ START_TEST(factory_provisioned_key) free(certificate_chain); } END_TEST -#endif // TODO: Enabled when we have better support and knowledge about EOS. #if 0 @@ -825,7 +821,6 @@ START_TEST(w_wo_emulation_prevention_bytes) signed_video_t *sv = get_initialized_signed_video(setting, false); ck_assert(sv); -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS const size_t attestation_size = 2; void *attestation = calloc(1, attestation_size); // Setting |attestation| and |certificate_chain|. @@ -834,7 +829,6 @@ START_TEST(w_wo_emulation_prevention_bytes) ck_assert_int_eq(sv_rc, SV_OK); free(attestation); setting.vendor_axis_mode = 0; -#endif // Add I-frame for signing and get SEI frame sv_rc = signed_video_add_nalu_for_signing_with_timestamp( @@ -966,10 +960,8 @@ signed_video_suite(void) // Add tests tcase_add_loop_test(tc, api_inputs, s, e); tcase_add_loop_test(tc, incorrect_operation, s, e); -#ifdef SV_VENDOR_AXIS_COMMUNICATIONS tcase_add_loop_test(tc, vendor_axis_communications_operation, s, e); tcase_add_loop_test(tc, factory_provisioned_key, s, e); -#endif // tcase_add_loop_test(tc, correct_signed_stream_with_eos, s, e); // tcase_add_loop_test(tc, correct_signed_multislice_stream_with_eos, s, e); tcase_add_loop_test(tc, correct_signed_stream_without_eos, s, e); diff --git a/tests/test_checks.sh b/tests/test_checks.sh index 9d9f5fd6..0ad03d40 100755 --- a/tests/test_checks.sh +++ b/tests/test_checks.sh @@ -29,15 +29,9 @@ echo "" meson setup -Ddebugprints=false -Dbuildtype=debug -Dsigningplugin=threaded_unless_check_dep --reconfigure . build ninja -C build test -echo "=== Run check tests without any vendors ===" -echo "" - -meson setup -Dbuildtype=debug -Dsigningplugin=unthreaded -Dvendors= --reconfigure . build -ninja -C build test - echo "" echo "=== Run check tests with all vendors and SIGNED_VIDEO_DEBUG ===" echo "" -meson setup -Ddebugprints=true -Dbuildtype=debug -Dvendors=all --reconfigure . build +meson setup -Ddebugprints=true -Dbuildtype=debug -Dsigningplugin=unthreaded --reconfigure . build ninja -C build test