From 8b08a406c82dd118053bb08eb87e1291ae1f70d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi
Date: Fri, 13 Jan 2023 07:59:11 +0200
Subject: [PATCH 1/1] TlsRequest: Querying name of the SSL library
CHANGES.md | 1 +
include/the_Foundation/tlsrequest.h | 1 +
src/tlsrequest.c | 13 +++++++++++++
3 files changed, 15 insertions(+)
diff --git a/CHANGES.md b/CHANGES.md
index c061234..0943ac7 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -3,6 +3,7 @@
+* TlsRequest: Added a method to query the SSL library name (OpenSSL/LibreSSL).
diff --git a/include/the_Foundation/tlsrequest.h b/include/the_Foundation/tlsrequest.h
index d0e4d06..9880db0 100644
--- a/include/the_Foundation/tlsrequest.h
+++ b/include/the_Foundation/tlsrequest.h
@@ -148,5 +148,6 @@ typedef iBool (*iTlsRequestVerifyFunc)(iTlsRequest *, const iTlsCertificate *, i
void setCACertificates_TlsRequest(const iString *caFile, const iString *caPath);
void setCiphers_TlsRequest (const char *cipherList);
void setVerifyFunc_TlsRequest (iTlsRequestVerifyFunc verifyFunc);
+const char libraryName_TlsRequest (void); / "OpenSSL" or "LibreSSL", for example */
iEndPublic
diff --git a/src/tlsrequest.c b/src/tlsrequest.c
index 745a34f..a5e897f 100644
--- a/src/tlsrequest.c
+++ b/src/tlsrequest.c
@@ -124,6 +124,7 @@ static void reuse_CachedSession(const iCachedSession *d, SSL *ssl) {
}
struct Impl_Context {
SSL_CTX * ctx;
X509_STORE * certStore;
iTlsRequestVerifyFunc userVerifyFunc;
@@ -230,6 +231,12 @@ static int verifyCallback_Context_(int preverifyOk, X509_STORE_CTX *storeCtx) {
}
void init_Context(iContext *d) {
+#if defined (LIBRESSL_VERSION_TEXT)
+#else
+#endif
d->tssKeyCurrentRequest = 0;
tss_create(&d->tssKeyCurrentRequest, NULL);
#if OPENSSL_API_COMPAT >= 0x10100000L
@@ -263,6 +270,7 @@ void deinit_Context(iContext *d) {
deinit_Mutex(&d->cacheMutex);
SSL_CTX_free(d->ctx);
tss_delete(d->tssKeyCurrentRequest);
}
iBool isValid_Context(iContext *d) {
@@ -826,6 +834,11 @@ void setCiphers_TlsRequest(const char *cipherList) {
SSL_CTX_set_cipher_list(context_->ctx, cipherList);
}
+const char *libraryName_TlsRequest(void) {
+}
void init_TlsRequest(iTlsRequest *d) {
initContext_();
init_Mutex(&d->mtx);
--
2.25.1
text/plain
This content has been proxied by September (ba2dc).