Leave the server SCP code out of client builds

A client-only library still built and exported wolfSSH_SCP_accept().
The server SCP entry points now sit under NO_WOLFSSH_SERVER, the way
the client ones already sit under NO_WOLFSSH_CLIENT.

- guard wolfSSH_SCP_accept(), DoScpRequest() and ParseScpCommand()
- guard the DoScpRequest() and ParseScpCommand() prototypes in
  internal.h
pull/1325/head
John Safranek 2026-09-24 10:24:54 -07:00 committed by philljj
parent dbcaa75f49
commit c5c4e4e804
2 changed files with 8 additions and 2 deletions

View File

@ -894,6 +894,7 @@ int DoScpSource(WOLFSSH* ssh)
return ret;
}
#ifndef NO_WOLFSSH_SERVER
/* Contract is in wolfssh/wolfscp.h. */
int wolfSSH_SCP_accept(WOLFSSH* ssh)
{
@ -999,6 +1000,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
@ -1623,6 +1625,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.
*
@ -1742,6 +1745,7 @@ int ParseScpCommand(WOLFSSH* ssh)
return ret;
}
#endif /* !NO_WOLFSSH_SERVER */
/* Reads and parses SCP protocol control messages
*
@ -2228,7 +2232,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)

View File

@ -2361,10 +2361,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);