mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-29 13:01:13 +03:00
Remove support for DSA Keys
Solving issue #110. The original work is at !231 Some changes were needed because the newly added features in master through time Signed-off-by: Mohammad Shehar Yaar Tausif <sheharyaar48@gmail.com> Signed-off-by: Norbert Pocs <npocs@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
committed by
Jakub Jelen
parent
486df37a84
commit
a3a13eb3a8
@ -45,7 +45,6 @@ struct arguments_st {
|
||||
char *port;
|
||||
|
||||
char *ecdsa_key;
|
||||
char *dsa_key;
|
||||
char *ed25519_key;
|
||||
char *rsa_key;
|
||||
char *host_key;
|
||||
@ -74,7 +73,6 @@ static void free_arguments(struct arguments_st *arguments)
|
||||
SAFE_FREE(arguments->port);
|
||||
|
||||
SAFE_FREE(arguments->ecdsa_key);
|
||||
SAFE_FREE(arguments->dsa_key);
|
||||
SAFE_FREE(arguments->ed25519_key);
|
||||
SAFE_FREE(arguments->rsa_key);
|
||||
SAFE_FREE(arguments->host_key);
|
||||
@ -153,8 +151,6 @@ static void print_server_state(struct server_state_st *state)
|
||||
printf("=================================================\n");
|
||||
printf("ecdsa_key = %s\n",
|
||||
state->ecdsa_key? state->ecdsa_key: "NULL");
|
||||
printf("dsa_key = %s\n",
|
||||
state->dsa_key? state->dsa_key: "NULL");
|
||||
printf("ed25519_key = %s\n",
|
||||
state->ed25519_key? state->ed25519_key: "NULL");
|
||||
printf("rsa_key = %s\n",
|
||||
@ -218,13 +214,6 @@ static int init_server_state(struct server_state_st *state,
|
||||
state->ecdsa_key = NULL;
|
||||
}
|
||||
|
||||
if (arguments->dsa_key) {
|
||||
state->dsa_key = arguments->dsa_key;
|
||||
arguments->dsa_key = NULL;
|
||||
} else {
|
||||
state->dsa_key = NULL;
|
||||
}
|
||||
|
||||
if (arguments->ed25519_key) {
|
||||
state->ed25519_key = arguments->ed25519_key;
|
||||
arguments->ed25519_key = NULL;
|
||||
@ -363,14 +352,6 @@ static struct argp_option options[] = {
|
||||
.doc = "Set the ECDSA key.",
|
||||
.group = 0
|
||||
},
|
||||
{
|
||||
.name = "dsakey",
|
||||
.key = 'd',
|
||||
.arg = "FILE",
|
||||
.flags = 0,
|
||||
.doc = "Set the DSA key.",
|
||||
.group = 0
|
||||
},
|
||||
{
|
||||
.name = "ed25519key",
|
||||
.key = 'e',
|
||||
@ -486,14 +467,6 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state)
|
||||
goto end;
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
arguments->dsa_key = strdup(arg);
|
||||
if (arguments->dsa_key == NULL) {
|
||||
fprintf(stderr, "Out of memory\n");
|
||||
rc = ENOMEM;
|
||||
goto end;
|
||||
}
|
||||
break;
|
||||
case 'e':
|
||||
arguments->ed25519_key = strdup(arg);
|
||||
if (arguments->ed25519_key == NULL) {
|
||||
|
@ -46,7 +46,6 @@ void free_server_state(struct server_state_st *state)
|
||||
SAFE_FREE(state->address);
|
||||
|
||||
SAFE_FREE(state->ecdsa_key);
|
||||
SAFE_FREE(state->dsa_key);
|
||||
SAFE_FREE(state->ed25519_key);
|
||||
SAFE_FREE(state->rsa_key);
|
||||
SAFE_FREE(state->host_key);
|
||||
@ -159,18 +158,6 @@ int run_server(struct server_state_st *state)
|
||||
goto free_sshbind;
|
||||
}
|
||||
|
||||
if (state->dsa_key != NULL) {
|
||||
rc = ssh_bind_options_set(sshbind,
|
||||
SSH_BIND_OPTIONS_DSAKEY,
|
||||
state->dsa_key);
|
||||
if (rc != 0) {
|
||||
fprintf(stderr,
|
||||
"Error setting DSA key: %s\n",
|
||||
ssh_get_error(sshbind));
|
||||
goto free_sshbind;
|
||||
}
|
||||
}
|
||||
|
||||
if (state->rsa_key != NULL) {
|
||||
rc = ssh_bind_options_set(sshbind,
|
||||
SSH_BIND_OPTIONS_RSAKEY,
|
||||
|
@ -36,7 +36,6 @@ struct server_state_st {
|
||||
int port;
|
||||
|
||||
char *ecdsa_key;
|
||||
char *dsa_key;
|
||||
char *ed25519_key;
|
||||
char *rsa_key;
|
||||
char *host_key;
|
||||
|
Reference in New Issue
Block a user