mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 18:04:25 +09:00
Improve and document ssh_options_set_[dsa,rsa]_server_key().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@371 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -326,8 +326,8 @@ int ssh_options_allow_ssh2(SSH_OPTIONS *opt, int allow);
|
|||||||
int ssh_options_set_log_function(SSH_OPTIONS *opt,
|
int ssh_options_set_log_function(SSH_OPTIONS *opt,
|
||||||
void (*callback)(const char *message, SSH_SESSION *session, int verbosity));
|
void (*callback)(const char *message, SSH_SESSION *session, int verbosity));
|
||||||
int ssh_options_set_log_verbosity(SSH_OPTIONS *opt, int verbosity);
|
int ssh_options_set_log_verbosity(SSH_OPTIONS *opt, int verbosity);
|
||||||
void ssh_options_set_dsa_server_key(SSH_OPTIONS *opt, const char *dsakey);
|
int ssh_options_set_dsa_server_key(SSH_OPTIONS *opt, const char *dsakey);
|
||||||
void ssh_options_set_rsa_server_key(SSH_OPTIONS *opt, const char *rsakey);
|
int ssh_options_set_rsa_server_key(SSH_OPTIONS *opt, const char *rsakey);
|
||||||
int ssh_options_set_auth_callback(SSH_OPTIONS *opt, ssh_auth_callback cb,
|
int ssh_options_set_auth_callback(SSH_OPTIONS *opt, ssh_auth_callback cb,
|
||||||
void *userdata);
|
void *userdata);
|
||||||
|
|
||||||
|
|||||||
@@ -443,17 +443,48 @@ int ssh_options_set_identity(SSH_OPTIONS *opt, const char *identity){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \warning I don't remember what these functions are supposed
|
/**
|
||||||
* to set
|
* @brief Set the path to the dsa ssh host key.
|
||||||
|
*
|
||||||
|
* @param opt The options structure to use.
|
||||||
|
*
|
||||||
|
* @param dsakey The path to the dsa key to set.
|
||||||
|
*
|
||||||
|
* @return 0 on success, < 0 on error.
|
||||||
*/
|
*/
|
||||||
void ssh_options_set_dsa_server_key(SSH_OPTIONS *opt, const char *dsakey){
|
int ssh_options_set_dsa_server_key(SSH_OPTIONS *opt, const char *dsakey) {
|
||||||
opt->dsakey=strdup(dsakey);
|
if (opt == NULL || dsakey == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
opt->dsakey = strdup(dsakey);
|
||||||
|
if (opt->dsakey == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
/** \warning I don't remember what these functions are supposed
|
|
||||||
* to set
|
/**
|
||||||
|
* @brief Set the path to the ssh host rsa key.
|
||||||
|
*
|
||||||
|
* @param opt The options structure to use.
|
||||||
|
*
|
||||||
|
* @param rsakey The path to the rsa key to set.
|
||||||
|
*
|
||||||
|
* @return 0 on success, < 0 on error.
|
||||||
*/
|
*/
|
||||||
void ssh_options_set_rsa_server_key(SSH_OPTIONS *opt, const char *rsakey){
|
int ssh_options_set_rsa_server_key(SSH_OPTIONS *opt, const char *rsakey) {
|
||||||
opt->rsakey=strdup(rsakey);
|
if (opt == NULL || rsakey == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
opt->rsakey = strdup(rsakey);
|
||||||
|
if (opt->rsakey == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user