tDie early if encryption key is not provided - dedup - deduplicating backup program
(HTM) git clone git://git.z3bra.org/dedup.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 4abf001684538854fb31ed5aaa1d3019da241d06
(DIR) parent 0b71c907f1b957781c5850a7445e3fd6abbdfb43
(HTM) Author: sin <sin@2f30.org>
Date: Sun, 12 May 2019 20:39:08 +0100
Die early if encryption key is not provided
Diffstat:
M dup-init.c | 5 +++++
1 file changed, 5 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/dup-init.c b/dup-init.c
t@@ -6,6 +6,7 @@
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
+#include <strings.h>
#include <unistd.h>
#include "arg.h"
t@@ -104,6 +105,10 @@ main(int argc, char *argv[])
usage();
};
+ if (strcasecmp(param.ealgo, "XChaCha20-Poly1305") == 0 &&
+ keyfile == NULL)
+ errx(1, "expected encryption key");
+
if (snprintf(spath, sizeof(spath), "%s/%s",
repo, ARCHIVEPATH) >= sizeof(spath))
errx(1, "snprintf: %s: path too long", spath);