Skip to content

bearssl: support CURLOPT_CAINFO_BLOB#7468

Closed
AzazKamaz wants to merge 1 commit intocurl:masterfrom
AzazKamaz:bearssl-update
Closed

bearssl: support CURLOPT_CAINFO_BLOB#7468
AzazKamaz wants to merge 1 commit intocurl:masterfrom
AzazKamaz:bearssl-update

Conversation

@AzazKamaz
Copy link
Contributor

Just implement support to use CURLOPT_CAINFO_BLOB with bearssl.
Also fixed bearssl support building error on hostname = NULL; while having const char * const hostname = SSL_HOST_NAME();

There are four ways to implement support:

  • have one function with parsing cert file from the buffer and two ways to get buffer. I don't want to read an entire file into memory so denied
  • have two big functions with similar code buf from different sources. Too big code repeat so denied
  • parse cert file iteratively while having state struct. Need to split function into some struct, init(), dispose() and update(). Denied because of complexity
  • have some switches in the cert parsing function. The easiest way with a minimum amount of modification. Implemented this way

@bagder bagder added the TLS label Jul 21, 2021
@AzazKamaz
Copy link
Contributor Author

Actually, I am force pushing my branch to stay away from commits like "fix formatting" or "change initialization way"

Copy link
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CURLOPT_CAINFO_BLOB.3 man page need an update to clarify that bearssl also supports this option from >= 7.79.0, right?

@AzazKamaz
Copy link
Contributor Author

I have added info to docs and used DEBUGASSERT for check.
Also I have changed source->len ? source->len : strlen(source->data) to source->len because documentation requires pointer and size and strlen will cause problems if buffer is zero-length and not zero-determinated.
And added check source->len <= (size_t)INT_MAX same as in OpenSSL backend

@jsoref jsoref mentioned this pull request Jul 23, 2021
@AzazKamaz AzazKamaz requested a review from bagder July 23, 2021 10:23
@jay jay added the feature-window A merge of this requires an open feature window label Jul 26, 2021
@bagder
Copy link
Member

bagder commented Jul 28, 2021

Thanks!

@bagder bagder closed this in beb1b1c Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature-window A merge of this requires an open feature window TLS

Development

Successfully merging this pull request may close these issues.

5 participants