From f7e50634be71ce3028726f23edf14454109a04a8 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Fri, 21 Oct 2016 14:59:26 +0200 Subject: [PATCH] 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 --- g10/keydb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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