Github user mike-jumper commented on a diff in the pull request:

    https://github.com/apache/guacamole-server/pull/164#discussion_r189494122
  
    --- Diff: src/protocols/rdp/rdp_settings.c ---
    @@ -822,6 +838,32 @@ guac_rdp_settings* guac_rdp_parse_args(guac_user* user,
             guac_user_parse_args_string(user, GUAC_RDP_CLIENT_ARGS, argv,
                     IDX_SFTP_HOSTNAME, settings->hostname);
     
    +    /* The public SSH host key. */
    +    settings->sftp_host_key =
    +        guac_user_parse_args_string(user, GUAC_RDP_CLIENT_ARGS, argv,
    +                IDX_SFTP_HOST_KEY, NULL);
    +
    +    if(settings->sftp_host_key) {
    +        /* Type of public SSH host key. */
    +        char* str_host_key_type = guac_user_parse_args_string(user, 
GUAC_RDP_CLIENT_ARGS, argv,
    +                    IDX_SFTP_HOST_KEY_TYPE, "ssh-rsa");
    +        
    +        if (strcmp(str_host_key_type, "ssh-rsa") == 0)
    +            settings->sftp_host_key_type = LIBSSH2_KNOWNHOST_KEY_SSHRSA;
    +        else if (strcmp(str_host_key_type, "ssh-dss") == 0)
    +            settings->sftp_host_key_type = LIBSSH2_KNOWNHOST_KEY_SSHDSS;
    +        else if (strcmp(str_host_key_type, "rsa1") == 0)
    +            settings->sftp_host_key_type = LIBSSH2_KNOWNHOST_KEY_RSA1;
    +        else {
    --- End diff --
    
    Leveraging 
[`libssh2_knownhost_readline()`](https://www.libssh2.org/libssh2_knownhost_readline.html)
 might be a better alternative.


---

Reply via email to