Back to product page

CryptoInformation callback


Called before wodSFTP establishes an encrypted connection with the server.

Syntax

  • C
void (*CryptoInformation)(void *Sftp, char *Protocol, char *RemoteName, char *SCcipher, char *CScipher, char *Keys, int *Accept);
The CryptoInformation(void *Sftp,char *Protocol,char *RemoteName,char *SCcipher,char *CScipher,char *Keys,int *Accept) syntax has these parts:
void *SftpHandle of the created Sftp instance.
char *ProtocolHolds the selected protocol (SSH2 is the only possibility in SFTP protocol).
char *RemoteNameHolds the remote identification string.
char *SCcipherHolds the selected server to client encryption algorithm.
char *CScipherHolds the selected client to server encryption algorithm.
char *KeysHolds the key exchange algorithm selected.
int *AcceptWhen set to 0 (null, false), wodSFTP aborts the connection.

Remarks

The CryptoInformation callback is called after the first crypto negotiation has taken place, but before any sensitive information is sent to the server (such as username or password). This callback provides you with information about the selected encryption protocols and the remote server type.

At this point you can decide whether to continue with the connection or to abort it (by setting the Accept parameter to False) in which case wodSFTP will drop the connection.

NOTE: this callback is called only if you have created an instance of the SftpEventsStruct structure, and set its CryptoInformation member to the function implementing it.

Platforms

Windows