Skip to content

Commit 5a1f42b

Browse files
update copyright, wrap isspace, fix formating
1 parent 387ac29 commit 5a1f42b

7 files changed

Lines changed: 23 additions & 66 deletions

File tree

apps/wolfsshd/auth.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* auth.c
22
*
3-
* Copyright (C) 2014-2021 wolfSSL Inc.
3+
* Copyright (C) 2014-2022 wolfSSL Inc.
44
*
55
* This file is part of wolfSSH.
66
*
@@ -601,7 +601,8 @@ static int RequestAuthentication(const char* usr, int type, const byte* data,
601601
/* temporarily elevate permissions */
602602
if (ret == WOLFSSH_USERAUTH_SUCCESS &&
603603
wolfSSHD_AuthRaisePermissions(auth) != WS_SUCCESS) {
604-
wolfSSH_Log(WS_LOG_ERROR, "[SSHD] Failure to raise permissions for auth");
604+
wolfSSH_Log(WS_LOG_ERROR,
605+
"[SSHD] Failure to raise permissions for auth");
605606
ret = WOLFSSH_USERAUTH_FAILURE;
606607
}
607608

apps/wolfsshd/auth.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* auth.h
22
*
3-
* Copyright (C) 2014-2021 wolfSSL Inc.
3+
* Copyright (C) 2014-2022 wolfSSL Inc.
44
*
55
* This file is part of wolfSSH.
66
*

apps/wolfsshd/configuration.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* configuration.c
22
*
3-
* Copyright (C) 2014-2021 wolfSSL Inc.
3+
* Copyright (C) 2014-2022 wolfSSL Inc.
44
*
55
* This file is part of wolfSSH.
66
*
@@ -445,7 +445,7 @@ static int HandleInclude(WOLFSSHD_CONFIG *conf, const char *value)
445445
/* Ignore trailing whitespace */
446446
ptr = value + WSTRLEN(value) - 1;
447447
while (ptr != value) {
448-
if (!isspace(*ptr)) {
448+
if (!WISSPACE(*ptr)) {
449449
ptr--;
450450
}
451451
else {
@@ -649,12 +649,12 @@ static int CountWhitespace(const char* in, int inSz, byte inv)
649649
if (in != NULL) {
650650
for (; i < inSz; ++i) {
651651
if (inv) {
652-
if (isspace(in[i])) {
652+
if (WISSPACE(in[i])) {
653653
break;
654654
}
655655
}
656656
else {
657-
if (!isspace(in[i])) {
657+
if (!WISSPACE(in[i])) {
658658
break;
659659
}
660660
}

apps/wolfsshd/configuration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* configuration.h
22
*
3-
* Copyright (C) 2014-2021 wolfSSL Inc.
3+
* Copyright (C) 2014-2022 wolfSSL Inc.
44
*
55
* This file is part of wolfSSH.
66
*

apps/wolfsshd/wolfsshd.c

Lines changed: 4 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* wolfsshd.c
22
*
3-
* Copyright (C) 2014-2021 wolfSSL Inc.
3+
* Copyright (C) 2014-2022 wolfSSL Inc.
44
*
55
* This file is part of wolfSSH.
66
*
@@ -143,7 +143,8 @@ static void ShowUsage(void)
143143
{
144144
printf("wolfsshd %s\n", LIBWOLFSSH_VERSION_STRING);
145145
printf(" -? display this help and exit\n");
146-
printf(" -f <file name> Configuration file to use, default is /etc/ssh/sshd_config\n");
146+
printf(" -f <file name> Configuration file to use, default is "
147+
"/etc/ssh/sshd_config\n");
147148
printf(" -p <int> Port number to listen on\n");
148149
printf(" -d Turn on debug mode\n");
149150
printf(" -D Run in foreground (do not detach)\n");
@@ -271,61 +272,7 @@ static int SetupCTX(WOLFSSHD_CONFIG* conf, WOLFSSH_CTX** ctx)
271272
}
272273
}
273274

274-
/* Load in host public key */
275-
// {
276-
// if (userPubKey) {
277-
// byte* userBuf = NULL;
278-
// word32 userBufSz = 0;
279-
//
280-
// /* get the files size */
281-
// load_file(userPubKey, NULL, &userBufSz);
282-
//
283-
// /* create temp buffer and load in file */
284-
// if (userBufSz == 0) {
285-
// fprintf(stderr, "Couldn't find size of file %s.\n", userPubKey);
286-
// WEXIT(EXIT_FAILURE);
287-
// }
288-
//
289-
// userBuf = (byte*)WMALLOC(userBufSz, NULL, 0);
290-
// if (userBuf == NULL) {
291-
// fprintf(stderr, "WMALLOC failed\n");
292-
// WEXIT(EXIT_FAILURE);
293-
// }
294-
// load_file(userPubKey, userBuf, &userBufSz);
295-
// LoadPublicKeyBuffer(userBuf, userBufSz, &pwMapList);
296-
// }
297-
//
298-
// bufSz = (word32)WSTRLEN(samplePasswordBuffer);
299-
// WMEMCPY(keyLoadBuf, samplePasswordBuffer, bufSz);
300-
// keyLoadBuf[bufSz] = 0;
301-
// LoadPasswordBuffer(keyLoadBuf, bufSz, &pwMapList);
302-
//
303-
// if (userEcc) {
304-
// #ifndef WOLFSSH_NO_ECC
305-
// bufName = samplePublicKeyEccBuffer;
306-
// #endif
307-
// }
308-
// else {
309-
// #ifndef WOLFSSH_NO_RSA
310-
// bufName = samplePublicKeyRsaBuffer;
311-
// #endif
312-
// }
313-
// if (bufName != NULL) {
314-
// bufSz = (word32)WSTRLEN(bufName);
315-
// WMEMCPY(keyLoadBuf, bufName, bufSz);
316-
// keyLoadBuf[bufSz] = 0;
317-
// LoadPublicKeyBuffer(keyLoadBuf, bufSz, &pwMapList);
318-
// }
319-
//
320-
// bufSz = (word32)WSTRLEN(sampleNoneBuffer);
321-
// WMEMCPY(keyLoadBuf, sampleNoneBuffer, bufSz);
322-
// keyLoadBuf[bufSz] = 0;
323-
// LoadNoneBuffer(keyLoadBuf, bufSz, &pwMapList);
324-
//
325-
// #ifdef WOLFSSH_SMALL_STACK
326-
// WFREE(keyLoadBuf, NULL, 0);
327-
// #endif
328-
// }
275+
/* @TODO Load in host public key */
329276

330277
/* Set allowed connection type, i.e. public key / password */
331278

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ AS_IF([test "x$ENABLED_DISTRO" = "xyes"],
223223
AS_IF([test "x$ENABLED_ALL" = "xyes"],
224224
[ENABLED_KEYGEN=yes; ENABLED_SCP=yes; ENABLED_SFTP=yes; ENABLED_FWD=yes; ENABLED_SHELL=yes; ENABLED_AGENT=yes; ENABLED_SSHD=yes])
225225
AS_IF([test "x$ENABLED_SSHD" = "xyes"],
226-
[ENABLED_SHELL=yes;])
226+
[ENABLED_SHELL=yes])
227227

228228
# Set the defined flags for the code.
229229
AS_IF([test "x$ENABLED_INLINE" = "xno"],

wolfssh/port.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ extern "C" {
4141
/* This value needs to stay in sync with the actual value of DYNTYPE_STRING
4242
* from internal.h. */
4343

44+
#ifdef WOLFSSH_SSHD
45+
/* uses isspace (not always available from wolfSSL) */
46+
#ifdef XISSPACE
47+
#define WISSPACE XISSPACE
48+
#else
49+
#define WISSPACE isspace
50+
#endif
51+
#endif
52+
4453
/* setup memory handling */
4554
#ifndef WMALLOC_USER
4655
#ifdef WOLFSSL_USER_SETTINGS

0 commit comments

Comments
 (0)