mirror of
https://github.com/libssh2/libssh2.git
synced 2026-10-24 03:48:58 +03:00
src: fixup namespace for local fopen symbols
Follow-up to 521146a4f1 #2318
Closes #2324
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -35,10 +35,10 @@
|
||||
#include <errno.h>
|
||||
|
||||
#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
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user