This patch adds a suite of tests for OEMCrypto that verifying buffer overflow and off-by-one errors. The reference code has also been updated to pass these tests. The ODK library and the OEMCrypto API have not changed since the release of version 16.4.
102 lines
3.2 KiB
Python
102 lines
3.2 KiB
Python
# Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
|
|
#source code may only be used and distributed under the Widevine Master License
|
|
#Agreement.
|
|
|
|
{
|
|
'variables': {
|
|
'boringssl_libcrypto_path%': '../../../third_party/boringssl/boringssl.gyp:crypto',
|
|
'boringssl_libssl_path%': '../../../third_party/boringssl/boringssl.gyp:ssl',
|
|
'oemcrypto_dir': '../..',
|
|
'platform_specific_dir': '../../../linux/src',
|
|
'privacy_crypto_impl%': 'boringssl',
|
|
# Flag used to generate source based code coverage reports.
|
|
'generate_code_coverage_report%': 'false',
|
|
'util_dir': '../../../util',
|
|
},
|
|
'sources': [
|
|
'../../odk/src/core_message_deserialize.cpp',
|
|
'../../odk/src/core_message_serialize.cpp',
|
|
'../oec_device_features.cpp',
|
|
'../oec_key_deriver.cpp',
|
|
'../oemcrypto_corpus_generator_helper.cpp',
|
|
'../oec_session_util.cpp',
|
|
'../oemcrypto_corpus_generator_helper.cpp',
|
|
'oemcrypto_fuzz_helper.cc',
|
|
'../oemcrypto_session_tests_helper.cpp',
|
|
'<(platform_specific_dir)/file_store.cpp',
|
|
'<(platform_specific_dir)/log.cpp',
|
|
'<(util_dir)/src/platform.cpp',
|
|
'<(util_dir)/src/rw_lock.cpp',
|
|
'<(util_dir)/src/string_conversions.cpp',
|
|
'<(util_dir)/test/test_sleep.cpp',
|
|
'<(util_dir)/test/test_clock.cpp',
|
|
],
|
|
'include_dirs': [
|
|
'../../../third_party/fuzz',
|
|
'<(util_dir)/include',
|
|
'<(util_dir)/test',
|
|
'<(oemcrypto_dir)/include',
|
|
'<(oemcrypto_dir)/test',
|
|
'<(oemcrypto_dir)/test/fuzz_tests',
|
|
'<(oemcrypto_dir)/odk/include',
|
|
'<(oemcrypto_dir)/odk/src',
|
|
'<(oemcrypto_dir)/odkitee/oemcrypto_ta',
|
|
],
|
|
'includes': [
|
|
'../../../util/libssl_dependency.gypi',
|
|
],
|
|
'dependencies': [
|
|
'../../../third_party/gmock.gyp:gtest',
|
|
'../../../third_party/gmock.gyp:gmock',
|
|
],
|
|
'defines': [
|
|
'OEMCRYPTO_FUZZ_TESTS',
|
|
],
|
|
'conditions': [
|
|
['generate_code_coverage_report=="false"', {
|
|
# Include flags to build fuzzer binaries for cluster fuzz.
|
|
'cflags_cc': [
|
|
'-std=c++11',
|
|
'-fsanitize=fuzzer,address,undefined',
|
|
# Need -g flag to include source line numbers in error stack trace.
|
|
'-g',
|
|
],
|
|
'ldflags': [
|
|
'-fPIC',
|
|
'-fsanitize=fuzzer,address,undefined',
|
|
],
|
|
}],
|
|
['generate_code_coverage_report=="true"', {
|
|
# Include flags to build fuzzer binaries to generate source based code coverage reports.
|
|
'cflags_cc': [
|
|
'-std=c++11',
|
|
'-fprofile-instr-generate',
|
|
'-fcoverage-mapping',
|
|
],
|
|
'ldflags': [
|
|
'-fPIC',
|
|
'-fsanitize=fuzzer,address,undefined',
|
|
'-fprofile-instr-generate',
|
|
'-fcoverage-mapping',
|
|
],
|
|
}],
|
|
['oemcrypto_implementation_version=="reference"', {
|
|
# Include oemcrypto reference implementation code for building reference
|
|
# implementation fuzz binaries.
|
|
'includes': [
|
|
'../../ref/oec_ref.gypi',
|
|
],
|
|
}],
|
|
['oemcrypto_implementation_version=="odkitee"', {
|
|
# Include oemcrypto odkitee implementation code for building odkitee
|
|
# implementation fuzz binaries.
|
|
'dependencies': [
|
|
'../../odkitee/oemcrypto_ta/oemcrypto_ta.gyp:oemcrypto_ta',
|
|
],
|
|
}],
|
|
], # conditions
|
|
'libraries': [
|
|
'-lpthread',
|
|
],
|
|
}
|