aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2017-02-03 13:18:16 +0100
committerAndreas Schneider <asn@cryptomilk.org>2017-02-03 13:18:16 +0100
commitde369b46b1877d0f5546013518ef2a46932d6757 (patch)
tree79c96cac4802b37e355281d1c350f77372b3a46d
parent043560d7dd4973910c632b46ec0d2d615a56effb (diff)
downloadlibssh-de369b46b1877d0f5546013518ef2a46932d6757.tar.gz
libssh-de369b46b1877d0f5546013518ef2a46932d6757.tar.xz
libssh-de369b46b1877d0f5546013518ef2a46932d6757.zip
pki: Use byte mode for fopen()
BUG: https://red.libssh.org/issues/251 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/pki.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pki.c b/src/pki.c
index a3317cd9..91f972b1 100644
--- a/src/pki.c
+++ b/src/pki.c
@@ -1025,7 +1025,7 @@ int ssh_pki_import_pubkey_file(const char *filename, ssh_key *pkey)
return SSH_ERROR;
}
- file = fopen(filename, "r");
+ file = fopen(filename, "rb");
if (file == NULL) {
SSH_LOG(SSH_LOG_WARN, "Error opening %s: %s",
filename, strerror(errno));
@@ -1365,7 +1365,7 @@ int ssh_pki_export_pubkey_file(const ssh_key key,
return SSH_ERROR;
}
- fp = fopen(filename, "w+");
+ fp = fopen(filename, "wb+");
if (fp == NULL) {
return SSH_ERROR;
}