diff --git a/src/knownhost.c b/src/knownhost.c index 462216f2..b209dd23 100644 --- a/src/knownhost.c +++ b/src/knownhost.c @@ -930,7 +930,7 @@ int libssh2_knownhost_readfile(LIBSSH2_KNOWNHOSTS *hosts, return ssh2_err(hosts->session, LIBSSH2_ERROR_METHOD_NOT_SUPPORTED, "Unsupported type of known-host information store"); - fp = libssh2_fopen(filename, FOPEN_READTEXT); + fp = ssh2_fopen(filename, FOPEN_READTEXT); if(fp) { while(fgets(buf, sizeof(buf), fp)) { if(libssh2_knownhost_readline(hosts, buf, strlen(buf), type)) { @@ -1159,7 +1159,7 @@ int libssh2_knownhost_writefile(LIBSSH2_KNOWNHOSTS *hosts, return ssh2_err(hosts->session, LIBSSH2_ERROR_METHOD_NOT_SUPPORTED, "Unsupported type of known-host information store"); - fp = libssh2_fopen(filename, FOPEN_WRITETEXT); + fp = ssh2_fopen(filename, FOPEN_WRITETEXT); if(!fp) return ssh2_err(hosts->session, LIBSSH2_ERROR_FILE, "Failed to open file"); diff --git a/src/libgcrypt.c b/src/libgcrypt.c index aa48a1d3..a8b67336 100644 --- a/src/libgcrypt.c +++ b/src/libgcrypt.c @@ -265,7 +265,7 @@ int ssh2_rsa_new_private(ssh2_rsa_ctx **rsa, unsigned char *n, *e, *d, *p, *q, *e1, *e2, *coeff; unsigned int nlen, elen, dlen, plen, qlen, e1len, e2len, coefflen; - fp = libssh2_fopen(filename, "rb"); + fp = ssh2_fopen(filename, "rb"); if(!fp) return -1; @@ -379,7 +379,7 @@ int ssh2_dsa_new_private(ssh2_dsa_ctx **dsa, unsigned char *p, *q, *g, *y, *x; unsigned int plen, qlen, glen, ylen, xlen; - fp = libssh2_fopen(filename, "rb"); + fp = ssh2_fopen(filename, "rb"); if(!fp) return -1; diff --git a/src/mbedtls.c b/src/mbedtls.c index a00f3591..ccd11d42 100644 --- a/src/mbedtls.c +++ b/src/mbedtls.c @@ -1155,7 +1155,7 @@ int ssh2_ecdsa_new_private(ssh2_ecdsa_ctx **ec_ctx, mbedtls_pk_init(&pkey); - fp = libssh2_fopen(filename, "rb"); + fp = ssh2_fopen(filename, "rb"); if(!fp) goto cleanup; if(fseek(fp, 0, SEEK_END)) diff --git a/src/misc.c b/src/misc.c index a1759d12..7adfce03 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1196,7 +1196,7 @@ cleanup: return !!*out; } -FILE *libssh2_win32_fopen(const char *filename, const char *mode) +FILE *ssh2_win32_fopen(const char *filename, const char *mode) { FILE *fp = NULL; TCHAR *fixed = NULL; diff --git a/src/misc.h b/src/misc.h index b6e84d2a..3df18858 100644 --- a/src/misc.h +++ b/src/misc.h @@ -35,10 +35,10 @@ #include #ifdef _WIN32 -FILE *libssh2_win32_fopen(const char *filename, const char *mode); -#define libssh2_fopen libssh2_win32_fopen +FILE *ssh2_win32_fopen(const char *filename, const char *mode); +#define ssh2_fopen ssh2_win32_fopen #else -#define libssh2_fopen fopen +#define ssh2_fopen fopen #endif #ifdef LIBSSH2_NO_CLEAR_MEMORY diff --git a/src/openssl.c b/src/openssl.c index 640db4db..b035a8ba 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -1280,7 +1280,7 @@ static int ossl_rsa_openssh_priv_new(ssh2_rsa_ctx **rsa, OSSL_INIT_IF_NEEDED(); - fp = libssh2_fopen(filename, "r"); + fp = ssh2_fopen(filename, "r"); if(!fp) { ssh2_err(session, LIBSSH2_ERROR_FILE, "Unable to open OpenSSH RSA private key file"); @@ -1590,7 +1590,7 @@ static int ossl_dsa_openssh_priv_new(ssh2_dsa_ctx **dsa, OSSL_INIT_IF_NEEDED(); - fp = libssh2_fopen(filename, "r"); + fp = ssh2_fopen(filename, "r"); if(!fp) { ssh2_err(session, LIBSSH2_ERROR_FILE, "Unable to open OpenSSH DSA private key file"); @@ -2102,7 +2102,7 @@ int ssh2_ed25519_new_private(ssh2_ed25519_ctx **ed_ctx, OSSL_INIT_IF_NEEDED(); - fp = libssh2_fopen(filename, "r"); + fp = ssh2_fopen(filename, "r"); if(!fp) { ssh2_err(session, LIBSSH2_ERROR_FILE, "Unable to open ED25519 private key file"); @@ -3048,7 +3048,7 @@ static int ossl_ecdsa_openssh_priv_new(ssh2_ecdsa_ctx **ec_ctx, OSSL_INIT_IF_NEEDED(); - fp = libssh2_fopen(filename, "r"); + fp = ssh2_fopen(filename, "r"); if(!fp) { ssh2_err(session, LIBSSH2_ERROR_FILE, "Unable to open OpenSSH ECDSA private key file"); @@ -3570,7 +3570,7 @@ static int ossl_key_from_openssh_file(LIBSSH2_SESSION *session, OSSL_INIT_IF_NEEDED(); - fp = libssh2_fopen(privatekey, "r"); + fp = ssh2_fopen(privatekey, "r"); if(!fp) { ssh2_err(session, LIBSSH2_ERROR_FILE, "Unable to open private key file"); diff --git a/src/os400qc3.c b/src/os400qc3.c index a7909277..510e3898 100644 --- a/src/os400qc3.c +++ b/src/os400qc3.c @@ -2016,7 +2016,7 @@ static int load_rsa_private_file(LIBSSH2_SESSION *session, loadkeyproc proc1, loadkeyproc proc8, void *loadkeydata) { - FILE *fp = libssh2_fopen(filename, fopenrbmode); + FILE *fp = ssh2_fopen(filename, fopenrbmode); unsigned char *data = NULL; size_t datalen = 0; int ret; diff --git a/src/userauth.c b/src/userauth.c index eb90e149..203225ad 100644 --- a/src/userauth.c +++ b/src/userauth.c @@ -642,7 +642,7 @@ static int userauth_read_file_pubkey( ssh2_deb((session, LIBSSH2_TRACE_AUTH, "Loading public key file: %s", pubkeyfile)); /* Read Public Key */ - fd = libssh2_fopen(pubkeyfile, "rb"); + fd = ssh2_fopen(pubkeyfile, "rb"); if(!fd) return ssh2_err(session, LIBSSH2_ERROR_FILE, "Unable to open public key file"); diff --git a/src/wincng.c b/src/wincng.c index ad402a7e..1feb1480 100644 --- a/src/wincng.c +++ b/src/wincng.c @@ -910,7 +910,7 @@ static int wcng_load_pem(LIBSSH2_SESSION *session, FILE *fp; int ret; - fp = libssh2_fopen(filename, "rb"); + fp = ssh2_fopen(filename, "rb"); if(!fp) return -1; @@ -2442,7 +2442,7 @@ int ssh2_ecdsa_new_private(OUT ssh2_ecdsa_ctx **ec_ctx, "Passphrase-protected ECDSA private key " "files are unsupported"); - fp = libssh2_fopen(filename, "rb"); + fp = ssh2_fopen(filename, "rb"); if(!fp) { result = ssh2_err(session, LIBSSH2_ERROR_INVAL, "Opening the private key file failed");