From d09debe64cef2923b2fb9fa7d135314e324b64cc Mon Sep 17 00:00:00 2001 From: Christopher Wellons Date: Sat, 6 Jan 2018 14:01:13 -0500 Subject: [PATCH] Add ENCHIVE_FILE_EXTENSION compile-time option (#9) --- README.md | 5 +++++ config.h | 4 ++++ src/enchive.c | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b1e41b4..dc4bce7 100644 --- a/README.md +++ b/README.md @@ -266,6 +266,11 @@ The default program to use for `pinentry`. Whether or not to use `pinentry` by default when reading passphrases. +#### `ENCHIVE_FILE_EXTENSION` + +The file extension to add when archiving and remove when extracting. The +default is `.enchive`, as it appears in the examples. + #### `ENCHIVE_KEY_DERIVE_ITERATIONS` Power-of-two exponent for protection key derivation. Can be configured diff --git a/config.h b/config.h index 9f6781c..655c4ca 100644 --- a/config.h +++ b/config.h @@ -11,6 +11,10 @@ # define ENCHIVE_FORMAT_VERSION 3 #endif +#ifndef ENCHIVE_FILE_EXTENSION +# define ENCHIVE_FILE_EXTENSION .enchive +#endif + #ifndef ENCHIVE_KEY_DERIVE_ITERATIONS # define ENCHIVE_KEY_DERIVE_ITERATIONS 25 /* 32MB */ #endif diff --git a/src/enchive.c b/src/enchive.c index bce2d0c..e71494b 100644 --- a/src/enchive.c +++ b/src/enchive.c @@ -28,7 +28,7 @@ static char *pinentry_path = STR(ENCHIVE_PINENTRY_DEFAULT); static char *pinentry_path = 0; #endif -static const char enchive_suffix[] = ".enchive"; +static const char enchive_suffix[] = STR(ENCHIVE_FILE_EXTENSION); static struct { char *name;