initial autotools sshd addition

pull/435/head
Jacob Barthelmeh 2022-05-24 17:05:53 -06:00 committed by JacobBarthelmeh
parent 90827e95b0
commit c81fcbca39
5 changed files with 73 additions and 0 deletions

3
.gitignore vendored
View File

@ -54,6 +54,9 @@ examples/portfwd/portfwd
examples/sftpclient/wolfsftp
examples/scpclient/wolfscp
# applications
apps/wolfsshd
# test output
tests/*.test
*.trs

View File

@ -33,6 +33,7 @@ EXTRA_DIST+= LICENSING README.md ChangeLog.md
include src/include.am
include wolfssh/include.am
include apps/include.am
include examples/include.am
include tests/include.am
include keys/include.am

13
apps/include.am 100644
View File

@ -0,0 +1,13 @@
# vim:ft=automake
# All paths should be given relative to the root
if BUILD_SSHD
bin_PROGRAMS += apps/wolfsshd
noinst_HEADERS += examples/client/client.h
apps_wolfsshd_SOURCES = apps/wolfsshd.c
apps_wolfsshd_LDADD = src/libwolfssh.la
apps_wolfsshd_DEPENDENCIES = src/libwolfssh.la
endif
DISTCLEANFILES+= apps/.libs/wolfsshd

47
apps/wolfsshd.c 100644
View File

@ -0,0 +1,47 @@
/* wolfsshd.c
*
* Copyright (C) 2014-2021 wolfSSL Inc.
*
* This file is part of wolfSSH.
*
* wolfSSH is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfSSH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with wolfSSH. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef WOLFSSH_SSHD
#include <wolfssh/ssh.h>
#include <wolfssh/internal.h>
#include <wolfssh/log.h>
#include <wolfssl/wolfcrypt/wc_port.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#ifdef NO_INLINE
#include <wolfssh/misc.h>
#else
#define WOLFSSH_MISC_INCLUDED
#include "src/misc.c"
#endif
int main(int argc, char** argv)
{
(void)argc;
(void)argv;
printf("wolfSSH SSHD application\n");
return 0;
}
#endif /* WOLFSSH_SSHD */

View File

@ -171,6 +171,11 @@ AC_ARG_ENABLE([sftp],
[AS_HELP_STRING([--enable-sftp],[Enable SFTP support (default: disabled)])],
[ENABLED_SFTP=$enableval],[ENABLED_SFTP=no])
# SSHD
AC_ARG_ENABLE([sshd],
[AS_HELP_STRING([--enable-sshd],[Enable SSHD support (default: disabled)])],
[ENABLED_SSHD=$enableval],[ENABLED_SSHD=no])
# TCP/IP Forwarding
AC_ARG_ENABLE([fwd],
[AS_HELP_STRING([--enable-fwd],[Enable TCP/IP Forwarding support (default: disabled)])],
@ -230,6 +235,8 @@ AS_IF([test "x$ENABLED_SHELL" = "xyes"],
AS_IF([test "x$ENABLED_AGENT" = "xyes"],[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_AGENT"])
AS_IF([test "x$ENABLED_SMALLSTACK" = "xyes"],
[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_SMALL_STACK"])
AS_IF([test "x$ENABLED_SSHD" = "xyes"],
[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_SSHD"])
# Set the automake conditionals.
AM_CONDITIONAL([BUILD_EXAMPLE_SERVERS],[test "x$ENABLED_EXAMPLES" = "xyes"])
@ -242,6 +249,7 @@ AM_CONDITIONAL([BUILD_FWD],[test "x$ENABLED_FWD" = "xyes"])
AM_CONDITIONAL([BUILD_TERM],[test "x$ENABLED_TERM" = "xyes"])
AM_CONDITIONAL([BUILD_SHELL],[test "x$ENABLED_SHELL" = "xyes"])
AM_CONDITIONAL([BUILD_AGENT],[test "x$ENABLED_AGENT" = "xyes"])
AM_CONDITIONAL([BUILD_SSHD],[test "x$ENABLED_SSHD" = "xyes"])
AX_HARDEN_CC_COMPILER_FLAGS
@ -282,6 +290,7 @@ AS_ECHO([" * psuedo-terminal: $ENABLED_PTERM"])
AS_ECHO([" * echoserver shell support: $ENABLED_SHELL"])
AS_ECHO([" * scp: $ENABLED_SCP"])
AS_ECHO([" * sftp: $ENABLED_SFTP"])
AS_ECHO([" * sshd: $ENABLED_SSHD"])
AS_ECHO([" * agent: $ENABLED_AGENT"])
AS_ECHO([" * TCP/IP Forwarding: $ENABLED_FWD"])
AS_ECHO([" * Examples: $ENABLED_EXAMPLES"])