shaka-packager/packager/media/base
Joey Parrish 7b33f2065f
feat: Port AES and RSA crypto to mbedtls (#1119)
mbedtls works very differently from BoringSSL, and many changes had to
be made in the details of AES decryption to accomodate this.

Beyond the basic changes required for mbedtls, part of the CTS padding
implementation had to be rewritten. I believe this is because of an
assumption that held for BoringSSL, but not for mbedtls. I was unable to
determine what it was, so I rewrote the CTS decryption using reference
materials. After this, tests passed.

The deterministc PRNG I used with mbedtls in the RSA tests differs
somewhat from the old one, so the expected vectors had to be
regenerated. The old determinstic tests were also disabled, and are now
re-enabled.

Since cryptography is sensitive code, and because there were far more
changes needed here than just updating some headers and utility function
calls, this has been split into its own PR for separate review from the
rest of the media/base porting work.

Issue #1047 (CMake porting)
Issue #346 (absl porting)
2022-11-02 08:34:06 -07:00
..
test feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
CMakeLists.txt feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_cryptor.cc feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_cryptor.h feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_cryptor_unittest.cc feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_decryptor.cc feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_decryptor.h feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_encryptor.cc feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_encryptor.h feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_pattern_cryptor.cc feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_pattern_cryptor.h feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
aes_pattern_cryptor_unittest.cc feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
audio_stream_info.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
audio_stream_info.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
audio_timestamp_helper.cc cleanup: Convert all time parameters to signed 2021-08-05 18:24:15 +00:00
audio_timestamp_helper.h cleanup: Convert all time parameters to signed 2021-08-05 18:24:15 +00:00
audio_timestamp_helper_unittest.cc cleanup: Convert all time parameters to signed 2021-08-05 18:24:15 +00:00
bit_reader.cc Properly handle SkipBytes with num_bytes as 0 2020-12-23 11:08:33 -08:00
bit_reader.h Add cc_index to stream descriptor. 2021-02-17 18:33:53 +00:00
bit_reader_unittest.cc Properly handle SkipBytes with num_bytes as 0 2020-12-23 11:08:33 -08:00
bit_writer.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
bit_writer.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
bit_writer_unittest.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
buffer_reader.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
buffer_reader.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
buffer_writer.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
buffer_writer.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
buffer_writer_unittest.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
byte_queue.cc Fix segmented WebVTT test. 2020-09-16 13:24:16 -07:00
byte_queue.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
cc_stream_filter.cc Add cc_index to stream descriptor. 2021-02-17 18:33:53 +00:00
cc_stream_filter.h Add cc_index to stream descriptor. 2021-02-17 18:33:53 +00:00
closure_thread.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
closure_thread.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
closure_thread_unittest.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
common_pssh_generator.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
common_pssh_generator.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
container_names.cc Add TTML-in-MP4 output support. 2020-11-20 15:10:33 -08:00
container_names.h Share chunkers from the same input except for WVM 2018-01-22 17:43:25 -08:00
container_names_unittest.cc Allow CMAF file extensions 2019-03-26 12:27:46 -07:00
decrypt_config.cc Implement EncryptionHandler 2017-02-11 01:21:28 +00:00
decrypt_config.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
decryptor_source.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
decryptor_source.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
decryptor_source_unittest.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
encryption_config.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
fourccs.h Added MPEG-H support (mha1, mhm1) 2021-06-29 23:10:53 -07:00
http_key_fetcher.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
http_key_fetcher.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
http_key_fetcher_unittest.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
id3_tag.cc Implemented Id3Tag class to handle ID3 tag 2018-05-16 01:04:02 +00:00
id3_tag.h Implemented PackedAudioSegmenter 2018-05-16 21:52:11 +00:00
id3_tag_unittest.cc Implemented Id3Tag class to handle ID3 tag 2018-05-16 01:04:02 +00:00
key_fetcher.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
key_fetcher.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
key_source.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
key_source.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
language_utils.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
language_utils.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
limits.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
macros.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
media_base.gyp chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
media_handler.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
media_handler.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
media_handler_test_base.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
media_handler_test_base.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
media_parser.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
media_sample.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
media_sample.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
mock_aes_cryptor.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
muxer.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
muxer.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
muxer_options.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
muxer_options.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
muxer_util.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
muxer_util.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
muxer_util_unittest.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
network_util.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
network_util.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
offset_byte_queue.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
offset_byte_queue.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
offset_byte_queue_unittest.cc Replace scoped_ptr with std::unique_ptr 2016-08-18 17:12:36 -07:00
playready_key_source.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
playready_key_source.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
playready_pssh_generator.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
playready_pssh_generator.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
producer_consumer_queue.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
producer_consumer_queue_unittest.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
protection_system_ids.h Support Marlin DRM signaling in DASH 2018-10-01 20:22:58 +00:00
protection_system_specific_info.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
protection_system_specific_info.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
protection_system_specific_info_unittest.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
proto_json_util.cc Remove the usage of JsonWriter in SimpleHlsNotifier 2018-05-15 20:06:54 +00:00
proto_json_util.h Remove the usage of JsonWriter in SimpleHlsNotifier 2018-05-15 20:06:54 +00:00
pssh_generator.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
pssh_generator.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
pssh_generator_unittest.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
pssh_generator_util.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
pssh_generator_util.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
range.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
raw_key_source.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
raw_key_source.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
raw_key_source_unittest.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
rcheck.h Move fourccs.h and rcheck.h to media/base 2016-04-12 21:28:37 +00:00
request_signer.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
request_signer.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
rsa_key.cc feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
rsa_key.h feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
rsa_key_unittest.cc feat: Port AES and RSA crypto to mbedtls (#1119) 2022-11-02 08:34:06 -07:00
stream_info.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
stream_info.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
text_muxer.cc cleanup: Convert all time parameters to signed 2021-08-05 18:24:15 +00:00
text_muxer.h cleanup: Convert all time parameters to signed 2021-08-05 18:24:15 +00:00
text_sample.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
text_sample.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
text_stream_info.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
text_stream_info.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
text_track.h Clean up #ifndef in packager/media. (#310) 2017-12-19 16:56:36 -08:00
text_track_config.cc Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
text_track_config.h Rename top level namespace to shaka 2016-05-24 21:55:55 +00:00
timestamp.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
video_stream_info.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
video_stream_info.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
video_util.cc Move DerivePixelWidthHeight to video_util.cc 2019-08-05 11:56:20 -07:00
video_util.h Move DerivePixelWidthHeight to video_util.cc 2019-08-05 11:56:20 -07:00
video_util_unittest.cc Move DerivePixelWidthHeight to video_util.cc 2019-08-05 11:56:20 -07:00
widevine_common_encryption.proto Add a flag --video_feature for Widevine 2019-04-16 07:55:08 -07:00
widevine_key_source.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
widevine_key_source.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
widevine_key_source_unittest.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
widevine_pssh_data.proto chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
widevine_pssh_generator.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
widevine_pssh_generator.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00