Rename {load,save}key to {read,write}key - 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 fe9f87887380dd21504bc482b245398ae9be0d1a DIR parent 7da9e6101622a5682c04733dcf7f3ff849bcb9bf HTML Author: sin <sin@2f30.org> Date: Sun, 12 May 2019 10:18:57 +0100 Rename {load,save}key to {read,write}key Diffstat: M dup-check.c | 4 ++-- M dup-gc.c | 4 ++-- M dup-init.c | 4 ++-- M dup-keygen.c | 4 ++-- M dup-pack.c | 4 ++-- M dup-rm.c | 4 ++-- M dup-unpack.c | 4 ++-- M key.c | 4 ++-- M key.h | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) --- DIR diff --git a/dup-check.c b/dup-check.c @@ -50,8 +50,8 @@ initkey(char *keyfile) fd = open(keyfile, O_RDONLY); if (fd < 0) err(1, "open: %s", keyfile); - if (loadkey(fd, param.key, sizeof(param.key)) < 0) - errx(1, "loadkey: failed"); + if (readkey(fd, param.key, sizeof(param.key)) < 0) + errx(1, "readkey: failed"); param.keyloaded = 1; if (close(fd) < 0) err(1, "close: %s", keyfile); DIR diff --git a/dup-gc.c b/dup-gc.c @@ -48,8 +48,8 @@ initkey(char *keyfile) fd = open(keyfile, O_RDONLY); if (fd < 0) err(1, "open: %s", keyfile); - if (loadkey(fd, param.key, sizeof(param.key)) < 0) - errx(1, "loadkey: failed"); + if (readkey(fd, param.key, sizeof(param.key)) < 0) + errx(1, "readkey: failed"); param.keyloaded = 1; if (close(fd) < 0) err(1, "close: %s", keyfile); DIR diff --git a/dup-init.c b/dup-init.c @@ -49,8 +49,8 @@ initkey(char *keyfile) fd = open(keyfile, O_RDONLY); if (fd < 0) err(1, "open: %s", keyfile); - if (loadkey(fd, param.key, sizeof(param.key)) < 0) - errx(1, "loadkey: failed"); + if (readkey(fd, param.key, sizeof(param.key)) < 0) + errx(1, "readkey: failed"); param.keyloaded = 1; if (close(fd) < 0) err(1, "close: %s", keyfile); DIR diff --git a/dup-keygen.c b/dup-keygen.c @@ -45,8 +45,8 @@ main(int argc, char *argv[]) err(1, "open: %s", argv[0]); if (keygen(key, sizeof(key)) < 0) errx(1, "keygen: failed"); - if (savekey(fd, key, sizeof(key)) < 0) - errx(1, "savekey: failed"); + if (writekey(fd, key, sizeof(key)) < 0) + errx(1, "writekey: failed"); fsync(fd); if (close(fd) < 0) err(1, "close: %s", argv[0]); DIR diff --git a/dup-pack.c b/dup-pack.c @@ -49,8 +49,8 @@ initkey(char *keyfile) fd = open(keyfile, O_RDONLY); if (fd < 0) err(1, "open: %s", keyfile); - if (loadkey(fd, param.key, sizeof(param.key)) < 0) - errx(1, "loadkey: failed"); + if (readkey(fd, param.key, sizeof(param.key)) < 0) + errx(1, "readkey: failed"); param.keyloaded = 1; if (close(fd) < 0) err(1, "close: %s", keyfile); DIR diff --git a/dup-rm.c b/dup-rm.c @@ -48,8 +48,8 @@ initkey(char *keyfile) fd = open(keyfile, O_RDONLY); if (fd < 0) err(1, "open: %s", keyfile); - if (loadkey(fd, param.key, sizeof(param.key)) < 0) - errx(1, "loadkey: failed"); + if (readkey(fd, param.key, sizeof(param.key)) < 0) + errx(1, "readkey: failed"); param.keyloaded = 1; if (close(fd) < 0) err(1, "close: %s", keyfile); DIR diff --git a/dup-unpack.c b/dup-unpack.c @@ -49,8 +49,8 @@ initkey(char *keyfile) fd = open(keyfile, O_RDONLY); if (fd < 0) err(1, "open: %s", keyfile); - if (loadkey(fd, param.key, sizeof(param.key)) < 0) - errx(1, "loadkey: failed"); + if (readkey(fd, param.key, sizeof(param.key)) < 0) + errx(1, "readkey: failed"); param.keyloaded = 1; if (close(fd) < 0) err(1, "close: %s", keyfile); DIR diff --git a/key.c b/key.c @@ -19,7 +19,7 @@ keygen(unsigned char *key, size_t n) } int -savekey(int fd, unsigned char *key, size_t n) +writekey(int fd, unsigned char *key, size_t n) { assert(KEYSIZE == crypto_aead_xchacha20poly1305_ietf_KEYBYTES); if (n != KEYSIZE) @@ -30,7 +30,7 @@ savekey(int fd, unsigned char *key, size_t n) } int -loadkey(int fd, unsigned char *key, size_t n) +readkey(int fd, unsigned char *key, size_t n) { assert(KEYSIZE == crypto_aead_xchacha20poly1305_ietf_KEYBYTES); if (n != KEYSIZE) DIR diff --git a/key.h b/key.h @@ -1,3 +1,3 @@ extern int keygen(unsigned char *, size_t); -extern int savekey(int fd, unsigned char *, size_t); -extern int loadkey(int fd, unsigned char *, size_t); +extern int writekey(int fd, unsigned char *, size_t); +extern int readkey(int fd, unsigned char *, size_t);