obs-outputs: upgrade mbedtls dependency to v4 - #13864
Open
dsimidzija wants to merge 1 commit into
Open
Conversation
This aims to close obsproject#13601, the official migration guide was used for the following: * update cmake target modules and versions (mbedcrypto => tfpsacrypto) * remove deprecated entropy configuration (ctr_drbg + entropy) * migrate MD5 and HMAC to the new PSA API The official migration guide: https://github.com/Mbed-TLS/mbedtls/blob/development/docs/4.0-migration-guide.md
Collaborator
|
Keeping compat with v3 at build time is required. |
Author
|
I was afraid that might be a requirement. 😀 I don't think that will be a problem to accomplish with the code itself (I'm guessing it's enough to just rely on |
Collaborator
|
You should rebase, we recently drop the custom finder (there was already things in the work to remove it). Compatibility with MbedTLS 3 is required, we guarded to exclude 4 to reduce the number of report about not supporting 4 and having hopefully a better CMake error than include and linking issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The official mbedtls migration guide was used for the following:
The official migration guide:
https://github.com/Mbed-TLS/mbedtls/blob/development/docs/4.0-migration-guide.md
I've done the best I can to cover the guide material, but there are some concerns:
I've never used cmake, so I don't know if any further changes are needed there, for example, there is a message in
FindMbedTLS.cmakewhich states:Does this mean that this file should be removed, as it would now be obsolete?
I've added calls to
psa_crypto_init()for both HMAC and MD5 macros, which should be called before any crypto functions according to the new docs. Should this be moved toobs_module_load, as a counterpart tombedtls_psa_crypto_free? My gut tells me yes, but I wanted to double check what is the convention in OBS.Old code doesn't seem to have any error handling, so I've replicated that, but that makes me uneasy, the new PSA API can fail on each step (you can see it in the hmac_demo.c with
PSA_CHECK). However, I'm not sure how to implement that cleanly with the way these macros are used. I guess I'm just asking for confirmation that this is okay as-is.Motivation and Context
This aims to close #13601 .
How Has This Been Tested?
I've tested RTMP output with a local test server, with and without TLS (self-signed certificate). While I was able to establish a handshake in both versions, I was unable to view the stream when using RTMPS, but I suspect this might be due to the test server malfunctioning, as RTMP ingestion seemed to work without issues. Unfortunately I don't have any other place to test this on a live/prod server.
Additionally, I only have a Linux machine, so I have no means to check if this code works on other platforms.
Types of changes
Checklist: