Azure / azure-c-shared-utility

Azure C SDKs common code
Other
111 stars 203 forks source link

Check cURL TLS platform is valid and matches CSDK TLS platform #595

Closed momuno closed 2 years ago

momuno commented 2 years ago

This is no longer a direct memory leak fix. However, a memory leak can occur if cURL is configured to use a different TLS platform than the C SDK is using (particularly wrt mbedTLS and certificates), when using HTTP.

This fix checks that cURL is using a valid TLS platform that the CSDK supports (wolfSSL, OpenSSL, or mbedTLS), and that that platform matches what the C SDK is configured to use.

Consolidates else-if statements.

danewalton commented 2 years ago

It might be that the version of curl that we support doesn't yet have bearssl (based on the gate checks). If that's the case I'm good with just a comment noting that and maybe a warning that this curl version doesn't support it.

momuno commented 2 years ago

It might be that the version of curl that we support doesn't yet have bearssl (based on the gate checks). If that's the case I'm good with just a comment noting that and maybe a warning that this curl version doesn't support it.

Oh yikes. Looking at curl on GitHub, its bearssl.h file didn't even show up until November 2019. Gates are using 7.60 for cURL. that's old - May 2018. apt-get for Ubuntu 20.04 installs 7.68.