-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for building without wolfssl/openssl header files #8182
Conversation
Retest this please |
* Fix for `TlsSessionCacheGetAndLock` that was not checking the sessionIDSz, so could return a pointer to an invalid session (if 0's). Resolves issue with `test_wolfSSL_CTX_sess_set_remove_cb` test. * Fix cast warning with `HAVE_EX_DATA` in Windows VS. * Fix openssl_extra without PKCS12. * Refactor the EX data crypto and session API's to gate on `HAVE_EX_DATA_CRYPTO`. * Grouped the EX data API's in ssl.h * Moved API's in ssl.h to separate the compatibility ones from ours.
3eab871
to
ef67b1c
Compare
@@ -1120,7 +1120,9 @@ static int TlsSessionCacheGetAndLock(const byte *id, | |||
#else | |||
s = &sessRow->Sessions[idx]; | |||
#endif | |||
if (s && XMEMCMP(s->sessionID, id, ID_LEN) == 0 && s->side == side) { | |||
/* match session ID value and length */ | |||
if (s && s->sessionIDSz == ID_LEN && s->side == side && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@julek-wolfssl , please review this change. I spent over 8 hours tracking down this long standing bug. Occasionally this would be called with a session id of 0's and return an old released session and messing up the ex_data. The only solution I could find was to also check sessionIDSz
since it is set to 0 when the session is released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice refactor!
The only thing that I had to bring up is that this slightly increases the code size of the OPENSSL_EXTRA_X509_SMALL build. Adding the API's
wolfSSL_CTX_get_ex_data
wolfSSL_CTX_set_ex_data
Tested with ./configure --enable-opensslextra=x509small --enable-static --disable-shared && make && nm ./src/.libs/libwolfssl.a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks David!
…ue with wolfEngine and wolfProvider. Change behavior for openssl compatibility headers to be installed unless `--enable-opensslextra=noinstall` is used. Removed dependency on X509 small with SESSION_CERTS, KEEP_PEER_CERTS and KEEP_OUR_CERT.
…ue with wolfEngine and wolfProvider. Change behavior for openssl compatibility headers to be installed unless `--enable-opensslextra=noinstall` is used. Removed dependency on X509 small with SESSION_CERTS, KEEP_PEER_CERTS and KEEP_OUR_CERT.
In PR wolfSSL#8182 this line was accidentally wrapped in `#ifdef OPENSSL_EXTRA`
Description
Support for building without wolfssl/openssl header files.
TlsSessionCacheGetAndLock
that was not checking the sessionIDSz, so could return a pointer to an invalid session (if 0's). Resolves issue withtest_wolfSSL_CTX_sess_set_remove_cb
test.HAVE_SECRET_CALLBACK
only.HAVE_EX_DATA
in Windows VS.HAVE_EX_DATA_CRYPTO
.Fixes ZD 18465
Testing
Support building with wolfssl/openssl/*.h files removed.
Checklist