diff --git a/include/libssh/options.h b/include/libssh/options.h index fbe4a974..775933ae 100644 --- a/include/libssh/options.h +++ b/include/libssh/options.h @@ -24,7 +24,7 @@ struct ssh_options_struct { struct error_struct error; - char *banner; /* explicit banner to send */ + char *banner; char *username; char *host; char *bindaddr; @@ -34,10 +34,7 @@ struct ssh_options_struct { char *known_hosts_file; socket_t fd; /* specificaly wanted file descriptor, don't connect host */ int port; - int dont_verify_hostkey; /* Don't spare time, don't check host key ! unneeded to say it's dangerous and not safe */ - int use_nonexisting_algo; /* if user sets a not supported algorithm for kex, don't complain */ char *wanted_methods[10]; /* the kex methods can be choosed. better use the kex fonctions to do that */ - void *wanted_cookie; /* wants a specific cookie to be sent ? if null, generate a new one */ ssh_callbacks callbacks; /* Callbacks to user functions */ long timeout; /* seconds */ long timeout_usec; diff --git a/libssh/dh.c b/libssh/dh.c index 4f052516..9088bb9d 100644 --- a/libssh/dh.c +++ b/libssh/dh.c @@ -1000,12 +1000,6 @@ int signature_verify(ssh_session session, ssh_string signature) { enter_function(); - if (session->options->dont_verify_hostkey) { - ssh_log(session, SSH_LOG_FUNCTIONS, "Host key wasn't verified"); - leave_function(); - return 0; - } - pubkey = publickey_from_string(session,session->next_crypto->server_pubkey); if(pubkey == NULL) { leave_function(); diff --git a/libssh/kex.c b/libssh/kex.c index ded0247e..d5eba61e 100644 --- a/libssh/kex.c +++ b/libssh/kex.c @@ -341,11 +341,7 @@ int set_kex(ssh_session session){ int i; const char *wanted; enter_function(); - /* the client might ask for a specific cookie to be sent. useful for server debugging */ - if(options->wanted_cookie) - memcpy(client->cookie,options->wanted_cookie,16); - else - ssh_get_random(client->cookie,16,0); + ssh_get_random(client->cookie,16,0); client->methods=malloc(10 * sizeof(char **)); if (client->methods == NULL) { ssh_set_error(session, SSH_FATAL, "No space left"); diff --git a/libssh/options.c b/libssh/options.c index 275f9fea..e670f2bb 100644 --- a/libssh/options.c +++ b/libssh/options.c @@ -219,7 +219,7 @@ static char *get_username_from_uid(ssh_options opt, uid_t uid){ #endif static int ssh_options_set_algo(ssh_options opt, int algo, const char *list) { - if ((!opt->use_nonexisting_algo) && !verify_existing_algo(algo, list)) { + if (!verify_existing_algo(algo, list)) { ssh_set_error(opt, SSH_REQUEST_DENIED, "Setting method: no algorithm for method \"%s\" (%s)\n", ssh_kex_nums[algo], list); @@ -878,7 +878,7 @@ int ssh_options_set_wanted_algos(ssh_options opt, int algo, const char *list) { return -1; } - if ((!opt->use_nonexisting_algo) && !verify_existing_algo(algo, list)) { + if (!verify_existing_algo(algo, list)) { ssh_set_error(opt, SSH_REQUEST_DENIED, "Setting method: no algorithm " "for method \"%s\" (%s)\n", ssh_kex_nums[algo], list); return -1; diff --git a/libssh/server.c b/libssh/server.c index 1eb09d55..7e9ad0b8 100644 --- a/libssh/server.c +++ b/libssh/server.c @@ -285,15 +285,7 @@ static int server_set_kex(ssh_session session) { char *wanted; ZERO_STRUCTP(server); - /* - * The program might ask for a specific cookie to be sent. Useful for server - * debugging - */ - if (options->wanted_cookie) { - memcpy(server->cookie, options->wanted_cookie, 16); - } else { - ssh_get_random(server->cookie, 16, 0); - } + ssh_get_random(server->cookie, 16, 0); if (session->dsa_key != NULL && session->rsa_key != NULL) { if (ssh_options_set(options, SSH_OPTIONS_SERVER_HOSTKEY,