| CMakeLists.txt |
|
2116 |
- |
| qdtls_openssl.cpp |
|
47120 |
- |
| qdtls_openssl_p.h |
|
6313 |
- |
| qopenssl_p.h |
|
2559 |
- |
| qsslcontext_openssl.cpp |
|
31638 |
- |
| qsslcontext_openssl_p.h |
|
3162 |
- |
| qssldiffiehellmanparameters_openssl.cpp |
|
4610 |
- |
| qsslsocket_openssl_android.cpp |
|
2402 |
- |
| qsslsocket_openssl_symbols.cpp |
Note to maintainer:
-------------------
We load OpenSSL symbols dynamically. Because symbols are known to
disappear, and signatures sometimes change, between releases, we need to
be careful about how this is done. To ensure we don't end up dereferencing
null function pointers, and continue running even if certain functions are
missing, we define helper functions for each of the symbols we load from
OpenSSL, all prefixed with "q_" (declared in
qsslsocket_openssl_symbols_p.h). So instead of calling SSL_connect
directly, we call q_SSL_connect, which is a function that checks if the
actual SSL_connect fptr is null, and returns a failure if it is, or calls
SSL_connect if it isn't.
This requires a somewhat tedious process of declaring each function we
want to call in OpenSSL thrice: once with the q_, in _p.h, once using the
DEFINEFUNC macros below, and once in the function that actually resolves
the symbols, below the DEFINEFUNC declarations below.
There's one DEFINEFUNC macro declared for every number of arguments
exposed by OpenSSL (feel free to extend when needed). The easiest thing to
do is to find an existing entry that matches the arg count of the function
you want to import, and do the same.
The first macro arg is the function return type. The second is the
verbatim name of the function/symbol. Then follows a list of N pairs of
argument types with a variable name, and just the variable name (char *a,
a, char *b, b, etc). Finally there's two arguments - a suitable return
statement for the error case (for an int function, return 0 or return -1
is usually right). Then either just "return" or DUMMYARG, the latter being
for void functions.
Note: Take into account that these macros and declarations are processed
at compile-time, and the result depends on the OpenSSL headers the
compiling host has installed, but the symbols are resolved at run-time,
possibly with a different version of OpenSSL.
|
62828 |
- |
| qsslsocket_openssl_symbols_p.h |
|
35003 |
- |
| qtls_openssl.cpp |
|
74138 |
- |
| qtls_openssl_p.h |
|
3939 |
- |
| qtlsbackend_openssl.cpp |
|
19316 |
- |
| qtlsbackend_openssl_p.h |
|
3504 |
- |
| qtlskey_openssl.cpp |
|
18147 |
- |
| qtlskey_openssl_p.h |
|
2701 |
- |
| qwindowscarootfetcher.cpp |
|
10059 |
- |
| qwindowscarootfetcher_p.h |
|
1844 |
- |
| qx509_openssl.cpp |
|
32230 |
- |
| qx509_openssl_p.h |
|
2843 |
- |