summaryrefslogtreecommitdiffstats
path: root/g10/keydb.c
diff options
context:
space:
mode:
authorAndre Heinecke <aheinecke@intevation.de>2016-10-21 14:59:26 +0200
committerAndre Heinecke <aheinecke@intevation.de>2016-10-21 15:02:19 +0200
commitf7e50634be71ce3028726f23edf14454109a04a8 (patch)
treedf530b17bccddff875e7b3b161611e93f3d703af /g10/keydb.c
parentg10,scd: Fix ECC keygen. (diff)
downloadgnupg2-f7e50634be71ce3028726f23edf14454109a04a8.tar.xz
gnupg2-f7e50634be71ce3028726f23edf14454109a04a8.zip
g10: Write first keybox record in binary mode
* g10/keydb.c (maybe_create_keyring_or_box): Open in binary mode. -- This fixes keybox corruption on windows. Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
Diffstat (limited to 'g10/keydb.c')
-rw-r--r--g10/keydb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/g10/keydb.c b/g10/keydb.c
index e49e25fd9..b959f0521 100644
--- a/g10/keydb.c
+++ b/g10/keydb.c
@@ -415,7 +415,7 @@ maybe_create_keyring_or_box (char *filename, int is_box, int force_create)
that the detection magic will work the next time it is used. */
if (is_box)
{
- FILE *fp = fopen (filename, "w");
+ FILE *fp = fopen (filename, "wb");
if (!fp)
rc = gpg_error_from_syserror ();
else