Skip to content
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

Enable support for no TLS while allowing certificate manager #8273

Merged
merged 5 commits into from
Dec 17, 2024

Conversation

dgarske
Copy link
Contributor

@dgarske dgarske commented Dec 10, 2024

Description

Enable support for using certificate manager only.
Added --disable-tls option that can be used with --enable-all to disable TLS features and set NO_TLS.
Fixed issues building without TLS enabled (NO_TLS).
Fixed issues in test_tls13_apis with no filesystem or no RSA/ECC.

ZD 19054

Testing

Tested using

  • ./configure --disable-tlsv12 --disable-tls13 CFLAGS="-DNO_TLS" && make check
  • ./configure --disable-tlsv12 --disable-tls13 CFLAGS="-DNO_TLS" --enable-cryptocb --enable-crl && make check

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@dgarske dgarske assigned dgarske and wolfSSL-Bot and unassigned dgarske Dec 10, 2024
Copy link
Contributor

@douzzer douzzer left a comment

Choose a reason for hiding this comment

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

Tested with a fatter configuration:

./configure --quiet --disable-jobserver --enable-fips=disabled --enable-all --disable-all-osp --disable-quic --disable-tlsv12 --disable-tls13 --disable-dtls --disable-mcast --disable-srtp --disable-ocsp --disable-tlsx --disable-sni --disable-crl-monitor --disable-alpn CFLAGS="-DNO_TLS"

It's nearly clean. Had to make these changes to src/internal.c:

diff --git a/src/internal.c b/src/internal.c
index e10ba5092..eeeb7cf61 100644
--- a/src/internal.c
+++ b/src/internal.c
@@ -191,7 +191,7 @@ WOLFSSL_CALLBACKS needs LARGE_STATIC_BUFFERS, please add LARGE_STATIC_BUFFERS
     #else
         #define SSL_TICKET_CTX(ssl) ssl->ctx->ticketEncCtx
     #endif
-    #if !defined(WOLFSSL_NO_DEF_TICKET_ENC_CB)
+    #if !defined(WOLFSSL_NO_DEF_TICKET_ENC_CB) && !defined(NO_TLS)
         static int TicketEncCbCtx_Init(WOLFSSL_CTX* ctx,
                                        TicketEncCbCtx* keyCtx);
         static void TicketEncCbCtx_Free(TicketEncCbCtx* keyCtx);
@@ -2493,7 +2493,7 @@ int InitSSL_Ctx(WOLFSSL_CTX* ctx, WOLFSSL_METHOD* method, void* heap)
 #endif /* HAVE_EXTENDED_MASTER && !NO_WOLFSSL_CLIENT */
 
 #if defined(HAVE_SESSION_TICKET) && !defined(NO_WOLFSSL_SERVER)
-#ifndef WOLFSSL_NO_DEF_TICKET_ENC_CB
+#if !defined(WOLFSSL_NO_DEF_TICKET_ENC_CB) && !defined(NO_TLS)
     ret = TicketEncCbCtx_Init(ctx, &ctx->ticketKeyCtx);
     if (ret != 0) return ret;
     ctx->ticketEncCb = DefTicketEncCb;
@@ -2798,7 +2798,7 @@ void FreeSSL_Ctx(WOLFSSL_CTX* ctx)
 
         SSL_CtxResourceFree(ctx);
 #if defined(HAVE_SESSION_TICKET) && !defined(NO_WOLFSSL_SERVER) && \
-    !defined(WOLFSSL_NO_DEF_TICKET_ENC_CB)
+    !defined(WOLFSSL_NO_DEF_TICKET_ENC_CB) && !defined(NO_TLS)
         TicketEncCbCtx_Free(&ctx->ticketKeyCtx);
 #endif
         wolfSSL_RefFree(&ctx->ref);

It will also need some more gate fixes in api.c, and fixes for the gates on CipherRequires and AlertTypeToString, which turn up as undefined references when the lib is linked.

@douzzer douzzer assigned dgarske and unassigned wolfSSL-Bot Dec 17, 2024
…sable TLS features and set `NO_TLS`. Useful for allowing certificate manager and crypto compatibility API's only.
Copy link
Contributor

@douzzer douzzer left a comment

Choose a reason for hiding this comment

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

wunderbar

@douzzer douzzer merged commit 60afdb5 into wolfSSL:master Dec 17, 2024
148 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants