From ff3e0177f75228188677660c83d27d235c4c941f Mon Sep 17 00:00:00 2001 From: Lealem Amedie Date: Wed, 10 Jul 2024 15:06:51 -0700 Subject: [PATCH] Don't set banner unless specified in config --- apps/wolfsshd/wolfsshd.c | 4 ---- src/internal.c | 19 ++----------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/apps/wolfsshd/wolfsshd.c b/apps/wolfsshd/wolfsshd.c index 27bf1877b..03a1bc777 100644 --- a/apps/wolfsshd/wolfsshd.c +++ b/apps/wolfsshd/wolfsshd.c @@ -103,7 +103,6 @@ static WFILE* logFile = NULL; /* catch interrupts and close down gracefully */ static volatile byte quit = 0; -static const char defaultBanner[] = "wolfSSHD\n"; /* Initial connection information to pass on to threads/forks */ typedef struct WOLFSSHD_CONNECTION { @@ -319,9 +318,6 @@ static int SetupCTX(WOLFSSHD_CONFIG* conf, WOLFSSH_CTX** ctx, if (*banner) { wolfSSH_CTX_SetBanner(*ctx, (char*)*banner); } - else { - wolfSSH_CTX_SetBanner(*ctx, defaultBanner); - } } /* Load in host private key */ diff --git a/src/internal.c b/src/internal.c index 3eab81dba..c444bf309 100644 --- a/src/internal.c +++ b/src/internal.c @@ -658,19 +658,6 @@ INLINE static int IsMessageAllowed(WOLFSSH *ssh, byte msg) } -#ifdef DEBUG_WOLFSSH - -static const char cannedBanner[] = - "CANNED BANNER\r\n" - "This server is an example test server. " - "It should have its own banner, but\r\n" - "it is currently using a canned one in " - "the library. Be happy or not.\r\n"; -static const word32 cannedBannerSz = (word32)sizeof(cannedBanner) - 1; - -#endif /* DEBUG_WOLFSSH */ - - static const char cannedKexAlgoNames[] = #if !defined(WOLFSSH_NO_ECDH_NISTP256_KYBER_LEVEL1_SHA256) "ecdh-nistp256-kyber-512r3-sha256-d00@openquantumsafe.org," @@ -823,10 +810,8 @@ WOLFSSH_CTX* CtxInit(WOLFSSH_CTX* ctx, byte side, void* heap) ctx->scpRecvCb = wsScpRecvCallback; ctx->scpSendCb = wsScpSendCallback; #endif /* WOLFSSH_SCP */ -#ifdef DEBUG_WOLFSSH - ctx->banner = cannedBanner; - ctx->bannerSz = cannedBannerSz; -#endif /* DEBUG_WOLFSSH */ + ctx->banner = NULL; + ctx->bannerSz = 0; #ifdef WOLFSSH_CERTS ctx->certMan = wolfSSH_CERTMAN_new(ctx->heap); if (ctx->certMan == NULL)