Check against KEYSIZE for consistency - 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 a86d915a5ecf1dbf93e58b7461a7e6fc97d0643f
DIR parent 9fcd9f91190ab89a777da608d52215631ba4da91
HTML Author: sin <sin@2f30.org>
Date: Fri, 3 May 2019 12:37:07 +0100
Check against KEYSIZE for consistency
Diffstat:
M key.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
DIR diff --git a/key.c b/key.c
@@ -13,7 +13,7 @@ int
keygen(unsigned char *key, size_t n)
{
assert(KEYSIZE == crypto_aead_xchacha20poly1305_ietf_KEYBYTES);
- if (n != crypto_aead_xchacha20poly1305_ietf_KEYBYTES)
+ if (n != KEYSIZE)
return -1;
if (sodium_init() < 0)
return -1;
@@ -25,7 +25,7 @@ int
savekey(int fd, unsigned char *key, size_t n)
{
assert(KEYSIZE == crypto_aead_xchacha20poly1305_ietf_KEYBYTES);
- if (n != crypto_aead_xchacha20poly1305_ietf_KEYBYTES)
+ if (n != KEYSIZE)
return -1;
if (xwrite(fd, key, n) != n)
return -1;
@@ -36,7 +36,7 @@ int
loadkey(int fd, unsigned char *key, size_t n)
{
assert(KEYSIZE == crypto_aead_xchacha20poly1305_ietf_KEYBYTES);
- if (n != crypto_aead_xchacha20poly1305_ietf_KEYBYTES)
+ if (n != KEYSIZE)
return -1;
if (xread(fd, key, n) != n)
return -1;