|
NetBurner 3.5.6
PDF Version |
Topics | |
| SSH Error Codes | |
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. | |
The NetBurner SSH Library
| typedef int(* sshGetUserKeyFn) (const NBString &usernamePtr, NBString &publicKey, NBString &privateKey, NBString &keyType) |
#include <NbWolfSsh.h>
User provided SSH user key authenticate routine for clients.
| usernamePtr | Username in plain text | |
| [out] | publicKey | Used to return the corresponding public key for the user |
| [out] | privateKey | Used to return the corresponding pviate key for the user |
| [out] | keyType | Used to return the corresponding key type (ECC or RSA) for the user |
| >0 | Password available for the user |
| <=0 | Authentication failed |
#include <NbWolfSsh.h>
User provided SSH user password authentication routine for clients.
| usernamePtr | Username in plain text | |
| [out] | passwordPtr | Used to return the corresponding password for the user |
| >0 | Password available for the user |
| <=0 | Authentication failed |
| typedef int(* sshUserAuthenticateFn) (const char *usernamePtr, const char *passwordPtr) |
#include <NbWolfSsh.h>
[DEPRECATED] User provided SSH username and password authenticate routine for a server. Please consider sshUserAuthenticateWithTypeFn.
| usernamePtr | Username in plain text |
| passwordPtr | Password in plain text |
| 1 | Authentication passed |
| !1 | Authentication failed |
| typedef int(* sshUserAuthenticateWithTypeFn) (const char *usernamePtr, const char *authValPtr, AuthType authType) |
#include <NbWolfSsh.h>
User provided SSH user authenticate routine for a server.
| usernamePtr | Username in plain text |
| authValPtr | The value that is being passed in for authentication |
| authType | Either a password or a key |
| 1 | Authentication passed |
| !1 | Authentication failed |
| typedef int(* sshUserGetKeyFn) (int keyRequested, const unsigned char **keyBufferPtr, int *keyLengthPtr) |
#include <NbWolfSsh.h>
The user defined callback to get the server key used during the initial SSH negotiation.
| keyRequested | Type key requested (ECC or RSA) |
| keyBufferPtr | Buffer containing the key (ASN1 or PEM format supported) |
| keyLengthPtr | Size of the key in 8 bit bytes |
| 0 | Key and length are valid |
| -1 | Key requested is not available |
| int NbSshInit | ( | ) |
#include <NbWolfSsh.h>
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.
| SSH_SUCCESS | if SSH system has been correctly initialized. |
| Other | SSH error code if initialization was unsuccessful. |
| int SshAccept | ( | int | listenFd, |
| IPADDR * | clientAddress, | ||
| uint16_t * | securePort, | ||
| uint16_t | timeout ) |
#include <NbWolfSsh.h>
Accepts and negotiates SSH session. Automatically calls NbSshInit() if required.
| listenFd | File descriptor of listening socket |
| clientAddress | Address of client |
| securePort | Secure port of negotiated socket |
| timeout | Ticks to wait for connection, 0 is infinite |
| >0 | The secure file descriptor if successful. |
| Other | A TCP or SSH error code, depending on the error.. |
| sshGetUserKeyFn SshClientGetUserKeyFn | ( | void | ) |
#include <NbWolfSsh.h>
Gets the user defined client authentication function for getting a user key during authentication.
| sshGetUserPwFnPtr | Sets the user defined server authentication function. |
| sshGetUserPwFn SshClientGetUserPaswordFn | ( | void | ) |
#include <NbWolfSsh.h>
Gets the user defined client authentication function for getting a user password during authentication.
| A | pointer to the fuction that is currently set for passing in a user's password during authentication. |
| void SshClientSetGetUserKeyFn | ( | sshGetUserKeyFn | sshGetUserKeyFnPtr | ) |
#include <NbWolfSsh.h>
Sets the user defined client authentication function for getting user keys during SSH authentication.
| sshGetUserKeyFnPtr | Sets the user defined server authentication function. |
| void SshClientSetGetUserPaswordFn | ( | sshGetUserPwFn | sshGetUserPwFnPtr | ) |
#include <NbWolfSsh.h>
Sets the user defined client authentication function for getting user passwords during SSH authentication.
| sshGetUserPwFnPtr | Sets the user defined client authentication function. |
| int SshClrSockOption | ( | int | fd, |
| int | option ) |
#include <NbWolfSsh.h>
Clear SSH TCP socket options.
| fd | Socket file descriptor. |
| option | Socket option to clear: TCP Socket Options. |
| int SshConnect | ( | IPADDR | clientAddress, |
| uint16_t | securePort, | ||
| uint16_t | localPort, | ||
| uint16_t | timeout, | ||
| const char * | username ) |
#include <NbWolfSsh.h>
Issues a connect request to negotiates an SSH session. Automatically calls NbSshInit() if required.
| clientAddress | Address of client |
| securePort | Secure port of negotiated socket |
| localPort | Optional parameter to specify a Local port number. Recommend this always be set to a value of 0 so a random local port number is used. |
| timeout | Ticks to wait for connection, 0 is infinite |
| username | Username to use in negotiation process of secure connection |
| >0 | The secure file descriptor if successful. |
| 0 | Request timed out. |
| <0 | A TCP or SSH error code, depending on the error.. |
| int SshGetKeySize | ( | ) |
#include <NbWolfSsh.h>
Determins and returns SSH's installed key size.
| int SshGetSockOption | ( | int | fd | ) |
#include <NbWolfSsh.h>
Returns the options for the specified SSH TCP socket.
| fd | Socket file descriptor. |
| sshUserAuthenticateFn SshGetUserAuthenticate | ( | void | ) |
#include <NbWolfSsh.h>
[DEPRECATED] Gets the user defined server authentication function. Please consider SshGetUserAuthenticateWithType.
| Returns | a pointer to the function fuction that is currently set for server user authentication. |
| sshUserAuthenticateWithTypeFn SshGetUserAuthenticateWithType | ( | void | ) |
#include <NbWolfSsh.h>
Gets the user defined server authentication function..
| A | pointer to the fuction that is currently set for server user authentication. |
| sshUserGetKeyFn SshGetUserGetKey | ( | void | ) |
#include <NbWolfSsh.h>
Gets the user defined callback method to provide the server key.
| sshUserGetKeyFn | The user defined callback |
| SshSocket * SshNegotiateSession | ( | int | fd | ) |
#include <NbWolfSsh.h>
Negotiates an SSH server session on an open file descriptor.
| fd | File descriptor to use in the SSN negotiation, usually obtained with a call to accept() |
| SshSocket * SshNegotiateSessionClient | ( | int | secureFd, |
| const char * | username ) |
#include <NbWolfSsh.h>
Negotiates an SSH client session on an open file descriptor.
| secureFd | File descriptor to use in the SSN negotiation |
| username | Username to use in negotiation process of secure connection |
| void SshPrintStatistics | ( | int | secureFd | ) |
#include <NbWolfSsh.h>
Negotiates an SSH client session on an open file descriptor.
| secureFd | Secure file descriptor |
| int SshSetBannerText | ( | const char * | banner | ) |
#include <NbWolfSsh.h>
Sets the banner text displayed by the SSH server on connection.
| banner | The text to display to any connected clients |
| SSH_SUCCESS | If successful |
| <0 | Error code on failure |
| int SshSetSockOption | ( | int | fd, |
| int | option ) |
#include <NbWolfSsh.h>
Set SSH TCP socket options.
| fd | Socket file descriptor. |
| option | Socket option to set: TCP Socket Options. |
| void SshSetUserAuthenticate | ( | sshUserAuthenticateFn | sshUserAuthenticateFnPtr | ) |
#include <NbWolfSsh.h>
[DEPRECATED] Sets the user defined server authentication function. Please consider sshUserAuthenticateWithTypeFn.
| sshUserAuthenticateFnPtr | Fuction to set |
| void SshSetUserAuthenticateWithType | ( | sshUserAuthenticateWithTypeFn | sshUserAuthenticateFnPtr | ) |
#include <NbWolfSsh.h>
Sets the user defined server authentication function.
| sshUserAuthenticateFnPtr | Fuction to set |
| void SshSetUserGetKey | ( | sshUserGetKeyFn | sshUserGetKeyFnPtr | ) |
#include <NbWolfSsh.h>
Sets the user defined callback method to provide the server key.
| sshUserGetKeyFnPtr | The user defined callback |
| bool SshValidateKey | ( | const char * | candidateKey, |
| int | candidateKeySize, | ||
| int * | keyTypePtr, | ||
| int | keyFormat = WOLFSSH_FORMAT_ASN1 ) |
#include <NbWolfSsh.h>
Takes a key and returns if it's valid or not.
| candidateKey | A pointer to a buffer containing the key | |
| candidateKeySize | The size of the key in bytes | |
| [out] | keyTypePtr | Is set to what kind of key is passed it (ECC and RSA are valid) |
| keyFormat | The key format (ASN1 or PEM) |
| true | The key is valid |
| false | The key is not valid |
| bool SshWritePublicKey | ( | int | publicKeyFd, |
| unsigned char * | candidateKey, | ||
| int | candidateKeySize ) |
#include <NbWolfSsh.h>
Write public key to file descriptor. Takes both PEM and ANS1 formats.
| publicKeyFd | Open target file descriptor |
| candidateKey | key in buffer |
| candidateKeySize | Size of key in bytes |
| true | A valid key was written to the file descriptor |
| false | An error occurred |