Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/os-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ jobs:
'--enable-all',
'--enable-all CFLAGS=-DWOLFSSH_LOCAL_PREAD_PWRITE',
'--enable-all --enable-ossh-certs',
'--enable-all --disable-server',
'--enable-all --disable-client',
'--enable-sftp',
'--enable-sftp --disable-sftp-zeroize',
'--enable-scp',
Expand Down
12 changes: 12 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,18 @@ 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_SSHCLIENT=yes; ENABLED_CERTS=yes; ENABLED_KEYBOARD_INTERACTIVE=yes])

# The apps need the side of the library they run on. Asking for one outright
# without its side is an error; getting it from --enable-all only drops it.
AS_IF([test "x$ENABLED_SERVER" = "xno" && test "x$ENABLED_SSHD" = "xyes"],
Comment thread
ejohnstown marked this conversation as resolved.
[AS_IF([test "x$enable_sshd" = "xyes"],
[AC_MSG_ERROR([--enable-sshd requires the server, leave out --disable-server.])],
[ENABLED_SSHD=no])])
AS_IF([test "x$ENABLED_CLIENT" = "xno" && test "x$ENABLED_SSHCLIENT" = "xyes"],
[AS_IF([test "x$enable_sshclient" = "xyes"],
[AC_MSG_ERROR([--enable-sshclient requires the client, leave out --disable-client.])],
[ENABLED_SSHCLIENT=no])])

AS_IF([test "x$ENABLED_SSHD" = "xyes"],
[ENABLED_SHELL=yes])

Expand Down
2 changes: 1 addition & 1 deletion examples/portfwd/portfwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ char* myoptarg = NULL;

#endif /* NO_MAIN_DRIVER */
#else
int main()
int main(void)
{
printf("NO_WOLFSSH_CLIENT macro used, wolfSSH client not compiled in.\n");
return -1;
Expand Down
2 changes: 1 addition & 1 deletion examples/scpclient/scpclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ char* myoptarg = NULL;

#endif /* NO_MAIN_DRIVER */
#else
int main()
int main(void)
{
printf("wolfSSH built with NO_WOLFSSH_CLIENT\n");
printf("SCP client unavailable\n");
Expand Down
6 changes: 5 additions & 1 deletion src/wolfscp.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@ int DoScpSource(WOLFSSH* ssh)
return ret;
}

#ifndef NO_WOLFSSH_SERVER
/* Contract is in wolfssh/wolfscp.h. */
int wolfSSH_SCP_accept(WOLFSSH* ssh)
{
Expand Down Expand Up @@ -992,6 +993,7 @@ int DoScpRequest(WOLFSSH* ssh)

return ret;
}
#endif /* !NO_WOLFSSH_SERVER */

/* Sets the error message that is sent back to the peer when an error or fatal
* confirmation message is sent. Expected to be used inside the scp
Expand Down Expand Up @@ -1616,6 +1618,7 @@ static int ParseBasePathHelper(WOLFSSH* ssh)
return ret;
}*/

#ifndef NO_WOLFSSH_SERVER
/* Parse scp command received, currently only looks for and stores the
* SCP base path being written to.
*
Expand Down Expand Up @@ -1735,6 +1738,7 @@ int ParseScpCommand(WOLFSSH* ssh)

return ret;
}
#endif /* !NO_WOLFSSH_SERVER */

/* Reads and parses SCP protocol control messages
*
Expand Down Expand Up @@ -2221,7 +2225,7 @@ int wolfSSH_SCP_from(WOLFSSH* ssh, const char* src, const char* dst)

return ret;
}
#endif /* ! NO_WOLFSSH_CLIENT */
#endif /* !NO_WOLFSSH_CLIENT */


#if !defined(WOLFSSH_SCP_USER_CALLBACKS)
Expand Down
15 changes: 8 additions & 7 deletions tests/regress.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@ static word32 AppendData(byte* buf, word32 bufSz, word32 idx,
return idx;
}

/* Callers sit in separate conditional blocks; some builds have none. */
static WS_MAYBE_UNUSED word32 AppendBlob(byte* buf, word32 bufSz, word32 idx,
const byte* data, word32 dataSz)
{
idx = AppendUint32(buf, bufSz, idx, dataSz);
return AppendData(buf, bufSz, idx, data, dataSz);
}

/* A string of any bytes, for the names a C string cannot hold. */
static word32 AppendStringSz(byte* buf, word32 bufSz, word32 idx,
const char* value, word32 valueSz)
Expand Down Expand Up @@ -842,13 +850,6 @@ static int ReadStringRef(word32* strSz, const byte** str,
return WS_SUCCESS;
}

static word32 AppendBlob(byte* buf, word32 bufSz, word32 idx,
const byte* data, word32 dataSz)
{
idx = AppendUint32(buf, bufSz, idx, dataSz);
return AppendData(buf, bufSz, idx, data, dataSz);
}

static int RegressionClientUserAuth(byte authType,
WS_UserAuthData* authData, void* ctx)
{
Expand Down
4 changes: 3 additions & 1 deletion wolfssh/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2322,10 +2322,12 @@ enum WS_ScpDirection {
WOLFSSH_SCP_FROM
};

#ifndef NO_WOLFSSH_SERVER
WOLFSSH_LOCAL int DoScpRequest(WOLFSSH* ssh);
WOLFSSH_LOCAL int ParseScpCommand(WOLFSSH* ssh);
#endif /* !NO_WOLFSSH_SERVER */
WOLFSSH_LOCAL int DoScpSink(WOLFSSH* ssh);
WOLFSSH_LOCAL int DoScpSource(WOLFSSH* ssh);
WOLFSSH_LOCAL int ParseScpCommand(WOLFSSH* ssh);
WOLFSSH_LOCAL int ReceiveScpMessage(WOLFSSH* ssh);
WOLFSSH_LOCAL int ReceiveScpFile(WOLFSSH* ssh);
WOLFSSH_LOCAL int SendScpConfirmation(WOLFSSH* ssh);
Expand Down
Loading