--- lbbs/src/test_ssh_server.c 2025/11/28 03:23:58 1.16 +++ lbbs/src/test_ssh_server.c 2025/12/01 14:01:36 1.17 @@ -25,6 +25,7 @@ enum test_ssh_server_constant_t static const char SSH_HOST_RSA_KEY_FILE[] = "../conf/ssh_host_rsa_key"; static const char SSH_HOST_ED25519_KEY_FILE[] = "../conf/ssh_host_ed25519_key"; +static const char SSH_HOST_ECDSA_KEY_FILE[] = "../conf/ssh_host_ecdsa_key"; static const char USER[] = "test"; static const char PASSWORD[] = "123456"; @@ -127,7 +128,7 @@ int ssh_server(const char *hostaddr, uns if (ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_HOSTKEY, SSH_HOST_RSA_KEY_FILE) < 0) { - log_error("Error setting SSH RSA key: %s\n", SSH_HOST_RSA_KEY_FILE); + log_error("Error loading SSH RSA key: %s\n", SSH_HOST_RSA_KEY_FILE); } else { @@ -135,7 +136,15 @@ int ssh_server(const char *hostaddr, uns } if (ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_HOSTKEY, SSH_HOST_ED25519_KEY_FILE) < 0) { - log_error("Error setting SSH ED25519 key: %s\n", SSH_HOST_ED25519_KEY_FILE); + log_error("Error loading SSH ED25519 key: %s\n", SSH_HOST_ED25519_KEY_FILE); + } + else + { + ssh_key_valid = 1; + } + if (ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_HOSTKEY, SSH_HOST_ECDSA_KEY_FILE) < 0) + { + log_error("Error loading SSH ECDSA key: %s\n", SSH_HOST_ECDSA_KEY_FILE); } else { @@ -151,7 +160,7 @@ int ssh_server(const char *hostaddr, uns if (ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_BINDADDR, hostaddr) < 0 || ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_BINDPORT, &port) < 0 || - ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_HOSTKEY_ALGORITHMS, "ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-ed25519") < 0 || + ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_HOSTKEY_ALGORITHMS, "+ssh-rsa") < 0 || ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_LOG_VERBOSITY, &ssh_log_level) < 0) { log_error("Error setting SSH bind options: %s\n", ssh_get_error(sshbind));