check_host_key_hash(BDRVSSHState *s, const char *hash,

                    int hash_type, size_t fingerprint_len)

{

    const char *fingerprint;



    fingerprint = libssh2_hostkey_hash(s->session, hash_type);

    if (!fingerprint) {

        session_error_report(s, "failed to read remote host key");

        return -EINVAL;

    }



    if(compare_fingerprint((unsigned char *) fingerprint, fingerprint_len,

                           hash) != 0) {

        error_report("remote host key does not match host_key_check '%s'",

                     hash);

        return -EPERM;

    }



    return 0;

}

check_host_key_hash(BDRVSSHState *s, const char *hash,

                    int hash_type, size_t fingerprint_len)

{

    const char *fingerprint;



    fingerprint = libssh2_hostkey_hash(s->session, hash_type);

    if (!fingerprint) {

        session_error_report(s, "failed to read remote host key");

        return -EINVAL;

    }



    if(compare_fingerprint((unsigned char *) fingerprint, fingerprint_len,

                           hash) != 0) {

        error_report("remote host key does not match host_key_check '%s'",

                     hash);

        return -EPERM;

    }



    return 0;

}

FUNC_0(BDRVSSHState *VAR_0, const char *VAR_1,

                    int VAR_2, size_t VAR_3)

{

    const char *VAR_4;



    VAR_4 = libssh2_hostkey_hash(VAR_0->session, VAR_2);

    if (!VAR_4) {

        session_error_report(VAR_0, "failed to read remote host key");

        return -EINVAL;

    }



    if(compare_fingerprint((unsigned char *) VAR_4, VAR_3,

                           VAR_1) != 0) {

        error_report("remote host key does not match host_key_check '%VAR_0'",

                     VAR_1);

        return -EPERM;

    }



    return 0;

}

FUNC_0(BDRVSSHState *VAR_0, const char *VAR_1,
int VAR_2, size_t VAR_3)
{ const char *VAR_4; VAR_4 = libssh2_hostkey_hash(VAR_0->session, VAR_2); if (!VAR_4) { session_error_report(VAR_0, "failed to read remote host key"); return -EINVAL; } if(compare_fingerprint((unsigned char *) VAR_4, VAR_3,
VAR_1) != 0) { error_report("remote host key does not match host_key_check '%VAR_0'",
VAR_1); return -EPERM; } return 0; }