Github user necouchman commented on a diff in the pull request:

    https://github.com/apache/guacamole-server/pull/164#discussion_r179728655
  
    --- 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 --
    
    Not 100% certain this is the best way to deal with translating this setting 
from the string provided by the client to the libssh2 bitmask?


---

Reply via email to