-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Simplify get-version string interface #10308
Copy link
Copy link
Labels
api-breakThis issue/PR breaks the API and must wait for a new major versionThis issue/PR breaks the API and must wait for a new major versionenhancementsize-xsEstimated task size: extra small (a few hours at most)Estimated task size: extra small (a few hours at most)
Metadata
Metadata
Assignees
Labels
api-breakThis issue/PR breaks the API and must wait for a new major versionThis issue/PR breaks the API and must wait for a new major versionenhancementsize-xsEstimated task size: extra small (a few hours at most)Estimated task size: extra small (a few hours at most)
Type
Projects
Status
1.0/4.0 SHOULDs
Status
Done
Ever since PolarSSL in 3ac1b2d, the interface to get the PolarSSL then Mbed TLS version string has been:
As noted by Bence this is fragile and overly complex. We could just return a global string instead.
(The macro isn't good enough because applications need the version of the library they're running on, not the version they were compiled against.)
We aren't going to change to constructing the version string dynamically from parts. That would take more code than the string. So we don't need the additional flexibility.
If we were doing this from scratch, I think we should make it
Both functions returning globals.
For the sake of applications that want to support both Mbed TLS 3.x and 4.x, we may want to maintain compatibility and introduce the new functions with the new name. On the other hand, application compatibility is already possible by calling
mbedtls_version_get_number()first.