![]() |
TrustCore SDK NanoSSH API reference
version 7.0
|
Variables | |
sbyte4(* | sshClientSettings::funcPtrCertStatus )(sbyte4 connectionInstance, sbyte4 cert_status, ubyte *pCertificate, ubyte4 certLen, certChainPtr pCertChain, const ubyte *pAnchorCert, ubyte4 anchorCertLen) |
Verify a client's certificate. More... | |
sbyte4(* | sshSettings::funcPtrCertStatus )(sbyte4 connectionInstance, const ubyte *pUser, ubyte4 userLength, sbyte4 cert_status, ubyte *pCertificate, ubyte4 certLen, certChainPtr pCertChain, const ubyte *pAnchorCert, ubyte4 anchorCertLen) |
Verify a client's certificate. More... | |
sbyte4(* | sshSettings::funcPtrConnect )(sbyte4 connectionInstance, sbyte4 sessionNum, ubyte *pConnectHost, ubyte2 port, sbyte4 *pIgnoreRequest, sbyte4 channel) |
(Optional) Custom connection handler. More... | |
sbyte4(* | sshSettings::funcPtrGetAuthAdvertizedMethods )(sbyte4 connectionInstance) |
(Optional) Custom authorization methods handler. More... | |
sbyte4(* | sshSettings::funcPtrKeyIntAuthReq )(sbyte4 connectionInstance, const ubyte *pUser, ubyte4 userLength, keyIntInfoResp *pResponseInfo, keyIntInfoReq *pRequestInfo, sbyte4 *pAuthState) |
Authorize a user for an interactive keyboard session. More... | |
sbyte4(* | sshSettings::funcPtrPasswordAuth )(sbyte4 connectionInstance, const ubyte *pUser, ubyte4 userLength, const ubyte *pPassword, ubyte4 passwordLength) |
Validate the provided password to complete authentication. More... | |
sbyte4(* | sshSettings::funcPtrPubKeyAuth )(sbyte4 connectionInstance, const ubyte *pUser, ubyte4 userLength, const ubyte *pPubKey, ubyte4 pubKeyLength, ubyte4 keyType) |
Verify a client's public key. More... | |
sbyte4(* | sshSettings::funcPtrReleaseKeyIntReq )(sbyte4 connectionInstance, keyIntInfoReq *request) |
Release (free) memory used by an unneeded request data buffer. More... | |
sbyte4(* | sshSettings::funcPtrSessionReKey )(sbyte4 connectionInstance, intBoolean initiatedByRemote) |
Inform the calling application that Session Rekey has been initiated. More... | |
sbyte4(* sshClientSettings::funcPtrCertStatus) (sbyte4 connectionInstance, sbyte4 cert_status, ubyte *pCertificate, ubyte4 certLen, certChainPtr pCertChain, const ubyte *pAnchorCert, ubyte4 anchorCertLen) |
This callback function is invoked during authentication to verify a client's certificate
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection(). |
cert_status | cert verification status done by the stack |
pCertificate | certificate of the peer |
certLen | length of the certificate buffer |
pCertChain | certificate chain leading the to anchor |
pAnchorCert | Anchor CA certificate if not present in pCertChain |
anchorCertLen | anchor cert length if present |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.sbyte4(* sshSettings::funcPtrCertStatus) (sbyte4 connectionInstance, const ubyte *pUser, ubyte4 userLength, sbyte4 cert_status, ubyte *pCertificate, ubyte4 certLen, certChainPtr pCertChain, const ubyte *pAnchorCert, ubyte4 anchorCertLen) |
This callback function is invoked during authentication to verify a client's certificate
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection(). |
pUser | Pointer to user name. |
userLength | Number of bytes in user name (pUser ). |
cert_status | cert verification status done by the stack |
pCertificate | certificate of the peer |
certLen | length of the certificate buffer |
pCertChain | certificate chain leading the to anchor |
pAnchorCert | Anchor CA certificate if not present in pCertChain |
anchorCertLen | anchor cert length if present |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.sbyte4(* sshSettings::funcPtrConnect) (sbyte4 connectionInstance, sbyte4 sessionNum, ubyte *pConnectHost, ubyte2 port, sbyte4 *pIgnoreRequest, sbyte4 channel) |
(Optional) If port forwarding is enabled, this callback function is invoked when a connection channel is opened. You can use this handler to block, redirect, or use a non-socket interface for an incoming channel open request. You can also change the connect address and/or port.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSH_PORT_FORWARDING__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection(). |
sessionNum | (Reserved for future use.) |
pConnectHost | IP Address of the host to be connected with NanoSSH server. |
port | Port number through which to connect to the NanoSSH server host. |
pIgnoreRequest | (Reserved for future use.) |
channel | Local port forwarded channel number. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.sbyte4(* sshSettings::funcPtrGetAuthAdvertizedMethods) (sbyte4 connectionInstance) |
This callback function is invoked at the start of authentication, when the 32-bit bitmask representing the selected authorization methods is returned. You can restrict authorization methods based on the incoming request characteristics, such as IP address.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection(). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.sbyte4(* sshSettings::funcPtrKeyIntAuthReq) (sbyte4 connectionInstance, const ubyte *pUser, ubyte4 userLength, keyIntInfoResp *pResponseInfo, keyIntInfoReq *pRequestInfo, sbyte4 *pAuthState) |
This callback function is invoked during interactive keyboard authentication to authorize a user.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection(). |
pUser | Pointer to user name. |
userLength | Number of bytes in user name (pUser ). |
pResponseInfo | Pointer to previous response buffer (or NULL if this is the first request). |
pRequestInfo | On return, pointer to request data. |
pAuthState | On return, pointer to state of authentication. Supported states: AUTH_FAIL - Authentication failed. AUTH_PASS - Authentication succeeded. AUTH_MORE - Additional info requests are necessary. AUTH_FAIL_MORE - Authentication failed, additional info requests are necessary. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.sbyte4(* sshSettings::funcPtrPasswordAuth) (sbyte4 connectionInstance, const ubyte *pUser, ubyte4 userLength, const ubyte *pPassword, ubyte4 passwordLength) |
This callback function is invoked as the final authentication step to validate the provided password.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection(). |
pUser | Pointer to user name. |
userLength | Number of bytes in user name (pUser ). |
pPassword | Pointer to password. |
passwordLength | Number of bytes in password (pPassword ). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.sbyte4(* sshSettings::funcPtrPubKeyAuth) (sbyte4 connectionInstance, const ubyte *pUser, ubyte4 userLength, const ubyte *pPubKey, ubyte4 pubKeyLength, ubyte4 keyType) |
This callback function is invoked during authentication to verify a client's public key.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection(). |
pUser | Pointer to user name. |
userLength | Number of bytes in user name (pUser ). |
pPubKey | Pointer to public key. The public key ( pubKeyLength ) is a byte string representation of the keyblob, both version 1 and version 2 are supported:
|
pubKeyLength | Number of bytes in public key (pPubKey ). |
keyType | Type of public key (pPubKey ).The following enumerated values (defined in ca_mgmt.h) are supported:
|
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.sbyte4(* sshSettings::funcPtrReleaseKeyIntReq) (sbyte4 connectionInstance, keyIntInfoReq *request) |
This callback function is invoked during interactive keyboard authentication to release (free) unneeded request data.
To enable this function, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_SERVER__
__ENABLE_MOCANA_SSH_ASYNC_SERVER_API__
connectionInstance | Connection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection(). |
request | Pointer to request to free. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.sbyte4(* sshSettings::funcPtrSessionReKey) (sbyte4 connectionInstance, intBoolean initiatedByRemote) |
This callback function is invoked on rekey negotiation start (initiated locally or by remote) - allowing the application to take update session context.
There are no flag dependencies to enable this callback.
connectionInstance | Connection instance returned from SSHC_connect. |
initiatedByRemote | True if the rekey was initiated by remote. |