Initialize sodium before generating random bytes - dedup - deduplicating backup program
HTML git clone git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
DIR LICENSE
---
DIR commit 877bf7ca5529c15deba0714df94d534e1e25e430
DIR parent eba08d1ff6618f1b3277dea6990a0afde7a0bc11
HTML Author: sin <sin@2f30.org>
Date: Sun, 19 May 2019 19:56:56 +0300
Initialize sodium before generating random bytes
Diffstat:
M dup-init.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
DIR diff --git a/dup-init.c b/dup-init.c
@@ -108,6 +108,9 @@ main(int argc, char *argv[])
usage();
};
+ if (sodium_init() < 0)
+ errx(1, "sodium_init: failed");
+
if (strcasecmp(param.ealgo, "none") == 0) {
param.seed = 0;
} else if (strcasecmp(param.ealgo, "XChaCha20-Poly1305") == 0) {
@@ -116,9 +119,6 @@ main(int argc, char *argv[])
param.seed = randombytes_uniform(0xffffffff);
}
- if (sodium_init() < 0)
- errx(1, "sodium_init: failed");
-
if (snprintf(spath, sizeof(spath), "%s/%s",
repo, ARCHIVEPATH) >= sizeof(spath))
errx(1, "snprintf: %s: path too long", spath);