aboutsummaryrefslogtreecommitdiff
path: root/src/common/crypto.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-09-08 07:16:34 +0000
committerNick Mathewson <nickm@torproject.org>2004-09-08 07:16:34 +0000
commit0ef85f6dbad170d7757b60c782d2b0df87eafb9d (patch)
tree548aaf844bde663bbad40ff7cda1350454496a7d /src/common/crypto.c
parentc66e4c48704b8be1425c2b6253542beed49ce0eb (diff)
downloadtor-0ef85f6dbad170d7757b60c782d2b0df87eafb9d.tar.gz
tor-0ef85f6dbad170d7757b60c782d2b0df87eafb9d.zip
Some platforms have weird translations when you open files in "test" mode; make read/write_str_to_file aware.
svn:r2336
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r--src/common/crypto.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 063f076144..9977d94ed4 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -345,7 +345,7 @@ int crypto_pk_read_private_key_from_filename(crypto_pk_env_t *env, const char *k
tor_assert(env && keyfile);
/* open the keyfile */
- f_pr=fopen(keyfile,"rb");
+ f_pr=fopen(keyfile,"r");
if (!f_pr)
return -1;
@@ -449,7 +449,7 @@ crypto_pk_write_private_key_to_filename(crypto_pk_env_t *env,
s = tor_malloc(len+1);
strncpy(s, cp, len);
s[len] = '\0';
- r = write_str_to_file(fname, s);
+ r = write_str_to_file(fname, s, 0);
BIO_free(bio);
free(s);
return r;