=> 8b08a406c82dd118053bb08eb87e1291ae1f70d7
[1mdiff --git a/CHANGES.md b/CHANGES.md[m [1mindex c061234..0943ac7 100644[m [1m--- a/CHANGES.md[m [1m+++ b/CHANGES.md[m [36m@@ -3,6 +3,7 @@[m ## 1.6 - Unreleased[m * Block: Added a method to encode contents in Base64.[m * TlsRequest: Avoid possible crash when reusing TLS sessions.[m [32m+[m[32m* TlsRequest: Added a method to query the SSL library name (OpenSSL/LibreSSL).[m [m ## 1.5 - 2022-11-25[m * RegExp: PCRE2 can be used as an alternative to the older PCRE.[m [1mdiff --git a/include/the_Foundation/tlsrequest.h b/include/the_Foundation/tlsrequest.h[m [1mindex d0e4d06..9880db0 100644[m [1m--- a/include/the_Foundation/tlsrequest.h[m [1m+++ b/include/the_Foundation/tlsrequest.h[m [36m@@ -148,5 +148,6 @@[m [mtypedef iBool (*iTlsRequestVerifyFunc)(iTlsRequest *, const iTlsCertificate *, i[m void setCACertificates_TlsRequest(const iString *caFile, const iString *caPath);[m void setCiphers_TlsRequest (const char *cipherList);[m void setVerifyFunc_TlsRequest (iTlsRequestVerifyFunc verifyFunc);[m [32m+[m[32mconst char *libraryName_TlsRequest (void); /* "OpenSSL" or "LibreSSL", for example */[m [m iEndPublic[m [1mdiff --git a/src/tlsrequest.c b/src/tlsrequest.c[m [1mindex 745a34f..a5e897f 100644[m [1m--- a/src/tlsrequest.c[m [1m+++ b/src/tlsrequest.c[m [36m@@ -124,6 +124,7 @@[m [mstatic void reuse_CachedSession(const iCachedSession *d, SSL *ssl) {[m }[m [m struct Impl_Context {[m [32m+[m[32m iString libraryName;[m SSL_CTX * ctx;[m X509_STORE * certStore;[m iTlsRequestVerifyFunc userVerifyFunc;[m [36m@@ -230,6 +231,12 @@[m [mstatic int verifyCallback_Context_(int preverifyOk, X509_STORE_CTX *storeCtx) {[m }[m [m void init_Context(iContext *d) {[m [32m+[m[32m init_String(&d->libraryName);[m [32m+[m[32m#if defined (LIBRESSL_VERSION_TEXT)[m [32m+[m[32m setCStr_String(&d->libraryName, "LibreSSL");[m [32m+[m[32m#else[m [32m+[m[32m setCStr_String(&d->libraryName, "OpenSSL");[m [32m+[m[32m#endif[m d->tssKeyCurrentRequest = 0;[m tss_create(&d->tssKeyCurrentRequest, NULL);[m #if OPENSSL_API_COMPAT >= 0x10100000L[m [36m@@ -263,6 +270,7 @@[m [mvoid deinit_Context(iContext *d) {[m deinit_Mutex(&d->cacheMutex);[m SSL_CTX_free(d->ctx);[m tss_delete(d->tssKeyCurrentRequest);[m [32m+[m[32m deinit_String(&d->libraryName);[m }[m [m iBool isValid_Context(iContext *d) {[m [36m@@ -826,6 +834,11 @@[m [mvoid setCiphers_TlsRequest(const char *cipherList) {[m SSL_CTX_set_cipher_list(context_->ctx, cipherList);[m }[m [m [32m+[m[32mconst char *libraryName_TlsRequest(void) {[m [32m+[m[32m initContext_();[m [32m+[m[32m return cstr_String(&context_->libraryName);[m [32m+[m[32m}[m [32m+[m void init_TlsRequest(iTlsRequest *d) {[m initContext_();[m init_Mutex(&d->mtx);[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).