Assert that if we are not dealing with keyfile we are dealing with passfile.

This commit is contained in:
Pawel Jakub Dawidek 2013-02-10 15:56:20 +00:00
parent d4e5fe17e6
commit 2d4b50b61e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=246621

View File

@ -380,6 +380,8 @@ eli_genkey_files(struct gctl_req *req, bool new, const char *type,
while ((done = read(fd, buf, sizeof(buf))) > 0)
g_eli_crypto_hmac_update(ctxp, buf, done);
} else /* if (strcmp(type, "passfile") == 0) */ {
assert(strcmp(type, "passfile") == 0);
while ((done = read(fd, buf, sizeof(buf) - 1)) > 0) {
buf[done] = '\0';
p = strchr(buf, '\n');