safe

Password protected secret keeper
git clone git://git.z3bra.org/safe.git
Log | Files | Refs | README | LICENSE

commit 788fd208467d17a169a655453b20510ba6245cfb
parent 5629cc83838f9cf85f53828e1f45cd6244abab58
Author: Willy Goiffon <dev@z3bra.org>
Date:   Wed,  5 Jun 2019 18:10:43 +0200

Write master salt outside writepass()

Diffstat:
safe.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/safe.c b/safe.c @@ -280,7 +280,6 @@ writepass(struct safe *s, uint8_t *m, size_t mlen, int fd) if (crypto_secretstream_xchacha20poly1305_push(&st, c, &clen, m, mlen, NULL, 0, crypto_secretstream_xchacha20poly1305_TAG_FINAL)) return -1; - xwrite(fd, s->salt, sizeof(s->salt)); xwrite(fd, h, sizeof(h)); xwrite(fd, c, clen); @@ -396,6 +395,7 @@ main(int argc, char *argv[]) } else { randombytes_buf(s.salt, sizeof(s.salt)); deriv((char *)passphrase, &s); + xwrite(fd, s.salt, sizeof(s.salt)); writepass(&s, passphrase, pplen, fd); close(fd); }