Skip to content

Commit

Permalink
Don't set banner unless specified in config
Browse files Browse the repository at this point in the history
  • Loading branch information
lealem47 committed Jul 10, 2024
1 parent 7fc63e8 commit ff3e017
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
4 changes: 0 additions & 4 deletions apps/wolfsshd/wolfsshd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 */
Expand Down
19 changes: 2 additions & 17 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ff3e017

Please sign in to comment.