NetBurner 3.5.0
PDF Version
 
NbWolfSsh.h File Reference

NetBurner SSH API. More...

#include <nettypes.h>
#include <stdio.h>
#include <basictypes.h>
#include <ssh/wolfssh/ssh.h>
#include <ssh/NetBurner/UserAuthManager.h>
#include <ssh/NetBurner/SshSocket.h>

Go to the source code of this file.

Macros

#define SSH_SUCCESS   (0)
 The function completed successfully.
 
#define SSH_ERROR_FAILED_SESSION_FAILED   (-300)
 Not currently used, kept for backward compatibility.
 
#define SSH_ERROR_FAILED_NEGOTIATION   (-301)
 The connection failed the SSH negotiation.
 
#define SSH_ERROR_FAILED_INITIALIZATION   (-302)
 The SSH system failed to initialize.
 
#define SSH_ERROR_FAILED_CONTEXT_INIT   (-303)
 Unable to instantiate SSH client/server context.
 
#define SSH_ERROR_BAD_KEY   (-304)
 The key provided was invalid.
 
#define SSH_ERROR_BAD_ARGUMENT   (-305)
 A bad argument was provided to the function.
 
#define SSH_FAILED_KEY_CHECK   (-306)
 There were no keys designated to use for the SSH library, .
 

Typedefs

typedef int(* sshUserAuthenticateFn) (const char *usernamePtr, const char *passwordPtr)
 [DEPRECATED] User provided SSH username and password authenticate routine for a server. Please consider sshUserAuthenticateWithTypeFn.
 
typedef int(* sshUserAuthenticateWithTypeFn) (const char *usernamePtr, const char *authValPtr, AuthType authType)
 User provided SSH user authenticate routine for a server.
 
typedef int(* sshGetUserPwFn) (const NBString &usernamePtr, NBString &passwordPtr)
 User provided SSH user password authentication routine for clients.
 
typedef int(* sshGetUserKeyFn) (const NBString &usernamePtr, NBString &publicKey, NBString &privateKey, NBString &keyType)
 User provided SSH user key authenticate routine for clients.
 
typedef int(* sshUserGetKeyFn) (int keyRequested, const unsigned char **keyBufferPtr, int *keyLengthPtr)
 The user defined callback to get the server key used during the initial SSH negotiation.
 

Functions

void SshSetUserAuthenticate (sshUserAuthenticateFn sshUserAuthenticateFnPtr)
 [DEPRECATED] Sets the user defined server authentication function. Please consider sshUserAuthenticateWithTypeFn.
 
sshUserAuthenticateFn SshGetUserAuthenticate (void)
 [DEPRECATED] Gets the user defined server authentication function. Please consider SshGetUserAuthenticateWithType.
 
void SshSetUserAuthenticateWithType (sshUserAuthenticateWithTypeFn sshUserAuthenticateFnPtr)
 Sets the user defined server authentication function.
 
sshUserAuthenticateWithTypeFn SshGetUserAuthenticateWithType (void)
 Gets the user defined server authentication function..
 
void SshClientSetGetUserPaswordFn (sshGetUserPwFn sshGetUserPwFnPtr)
 Sets the user defined client authentication function for getting user passwords during SSH authentication.
 
sshGetUserPwFn SshClientGetUserPaswordFn (void)
 Gets the user defined client authentication function for getting a user password during authentication.
 
void SshClientSetGetUserKeyFn (sshGetUserKeyFn sshGetUserKeyFnPtr)
 Sets the user defined client authentication function for getting user keys during SSH authentication.
 
sshGetUserKeyFn SshClientGetUserKeyFn (void)
 Gets the user defined client authentication function for getting a user key during authentication.
 
void SshSetUserGetKey (sshUserGetKeyFn sshUserGetKeyFnPtr)
 Sets the user defined callback method to provide the server key.
 
sshUserGetKeyFn SshGetUserGetKey (void)
 Gets the user defined callback method to provide the server key.
 
bool SshValidateKey (const char *candidateKey, int candidateKeySize, int *keyTypePtr, int keyFormat=WOLFSSH_FORMAT_ASN1)
 Takes a key and returns if it's valid or not.
 
bool SshWritePublicKey (int publicKeyFd, unsigned char *candidateKey, int candidateKeySize)
 Write public key to file descriptor. Takes both PEM and ANS1 formats.
 
int NbSshInit ()
 Initializes the underlying SSH framework. This will start a background task used to handle negotiations and SSH traffic. This is automatically called by SshAccept and SshConnect, and doesn't need to be called directly except in special circumstances.
 
int SshAccept (int listenFd, IPADDR *clientAddress, uint16_t *securePort, uint16_t timeout)
 Accepts and negotiates SSH session. Automatically calls NbSshInit() if required.
 
int SshConnect (IPADDR clientAddress, uint16_t securePort, uint16_t localPort, uint16_t timeout, const char *username)
 Issues a connect request to negotiates an SSH session. Automatically calls NbSshInit() if required.
 
SshSocket * SshNegotiateSession (int fd)
 Negotiates an SSH server session on an open file descriptor.
 
SshSocket * SshNegotiateSessionClient (int secureFd, const char *username)
 Negotiates an SSH client session on an open file descriptor.
 
void SshPrintStatistics (int secureFd)
 Negotiates an SSH client session on an open file descriptor.
 
int SshGetKeySize ()
 Determins and returns SSH's installed key size.
 
int SshSetBannerText (const char *banner)
 Sets the banner text displayed by the SSH server on connection.
 
int SshSetSockOption (int fd, int option)
 Set SSH TCP socket options.
 
int SshClrSockOption (int fd, int option)
 Clear SSH TCP socket options.
 
int SshGetSockOption (int fd)
 Returns the options for the specified SSH TCP socket.
 

Detailed Description

NetBurner SSH API.