Skip to content

Commit

Permalink
wolfSSH Client
Browse files Browse the repository at this point in the history
1. Add scaffold to the build for the wolfSSH client.
2. A little whitespace change in configure.ac.
  • Loading branch information
ejohnstown committed Sep 25, 2023
1 parent a650415 commit 7965c97
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ examples/sftpclient/wolfsftp
examples/scpclient/wolfscp

# applications
apps/wolfssh/wolfssh
apps/wolfsshd/wolfsshd
apps/wolfsshd/test/test_configuration

Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ EXTRA_DIST+= LICENSING README.md ChangeLog.md

include src/include.am
include wolfssh/include.am
include apps/wolfsshd/include.am
include apps/include.am
include examples/include.am
include tests/include.am
include keys/include.am
Expand Down
6 changes: 6 additions & 0 deletions apps/include.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root

include apps/wolfssh/include.am
include apps/wolfsshd/include.am
8 changes: 8 additions & 0 deletions apps/wolfssh/include.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if BUILD_SSHCLIENT

bin_PROGRAMS += apps/wolfssh/wolfssh
apps_wolfssh_wolfssh_SOURCES = apps/wolfssh/wolfssh.c
apps_wolfssh_wolfssh_LDADD = src/libwolfssh.la
apps_wolfssh_wolfssh_DEPENDENCIES = src/libwolfssh.la

endif BUILD_SSHCLIENT
30 changes: 30 additions & 0 deletions apps/wolfssh/wolfssh.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* wolfssh.c
*
* Copyright (C) 2014-2023 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

#include <stdio.h>

int main(void)
{
printf("hello world\n");
}
21 changes: 16 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ AC_ARG_ENABLE([sshd],
[AS_HELP_STRING([--enable-sshd],[Enable SSHD support (default: disabled)])],
[ENABLED_SSHD=$enableval],[ENABLED_SSHD=no])

# SSH Client
AC_ARG_ENABLE([sshclient],
[AS_HELP_STRING([--enable-sshclient],[Enable SSH client app (default: disabled)])],
[ENABLED_SSHCLIENT=$enableval],[ENABLED_SSHCLIENT=no])

# TCP/IP Forwarding
AC_ARG_ENABLE([fwd],
[AS_HELP_STRING([--enable-fwd],[Enable TCP/IP Forwarding support (default: disabled)])],
Expand Down Expand Up @@ -227,7 +232,7 @@ AC_ARG_ENABLE([distro],
AS_IF([test "x$ENABLED_DISTRO" = "xyes"],
[ENABLED_ALL=yes; enable_shared=yes; enable_static=yes])
AS_IF([test "x$ENABLED_ALL" = "xyes"],
[ENABLED_KEYGEN=yes; ENABLED_SCP=yes; ENABLED_SFTP=yes; ENABLED_FWD=yes; ENABLED_SHELL=yes; ENABLED_AGENT=yes; ENABLED_SSHD=yes; ENABLED_CERTS=yes])
[ENABLED_KEYGEN=yes; ENABLED_SCP=yes; ENABLED_SFTP=yes; ENABLED_FWD=yes; ENABLED_SHELL=yes; ENABLED_AGENT=yes; ENABLED_SSHD=yes; ENABLED_SSHCLIENT=yes; ENABLED_CERTS=yes])
AS_IF([test "x$ENABLED_SSHD" = "xyes"],
[ENABLED_SHELL=yes])

Expand All @@ -246,12 +251,16 @@ AS_IF([test "x$ENABLED_PTERM" = "xyes"],
[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_TERM"])
AS_IF([test "x$ENABLED_SHELL" = "xyes"],
[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_SHELL"])
AS_IF([test "x$ENABLED_AGENT" = "xyes"],[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_AGENT"])
AS_IF([test "x$ENABLED_CERTS" = "xyes"],[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_CERTS"])
AS_IF([test "x$ENABLED_AGENT" = "xyes"],
[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_AGENT"])
AS_IF([test "x$ENABLED_CERTS" = "xyes"],
[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_CERTS"])
AS_IF([test "x$ENABLED_SMALLSTACK" = "xyes"],
[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_SMALL_STACK"])
[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_SMALL_STACK"])
AS_IF([test "x$ENABLED_SSHD" = "xyes"],
[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_SSHD"])
[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_SSHD"])
AS_IF([test "x$ENABLED_SSHCLIENT" = "xyes"],
[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSH_SSHCLIENT"])

if test "$ENABLED_SSHD" = "yes"; then
if test -n "$PAM_LIB"
Expand Down Expand Up @@ -304,6 +313,7 @@ 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"])
AM_CONDITIONAL([BUILD_SSHCLIENT],[test "x$ENABLED_SSHCLIENT" = "xyes"])
AM_CONDITIONAL([BUILD_CERTS],[test "x$ENABLED_CERTS" = "xyes"])

AX_HARDEN_CC_COMPILER_FLAGS
Expand Down Expand Up @@ -346,6 +356,7 @@ AS_ECHO([" * echoserver shell support: $ENABLED_SHELL"])
AS_ECHO([" * scp: $ENABLED_SCP"])
AS_ECHO([" * sftp: $ENABLED_SFTP"])
AS_ECHO([" * sshd: $ENABLED_SSHD"])
AS_ECHO([" * ssh client: $ENABLED_SSHCLIENT"])
AS_ECHO([" * agent: $ENABLED_AGENT"])
AS_ECHO([" * TCP/IP Forwarding: $ENABLED_FWD"])
AS_ECHO([" * X.509 Certs: $ENABLED_CERTS"])
Expand Down

0 comments on commit 7965c97

Please sign in to comment.