They must not be empty, or else creation/unlock fails (and boot loaders
would not be able to abort and drop back to the boot> prompt).
[-p passfile] handles this with "invalid passphrase length", so align
the interactive prompt and retry there.
-s remains a one-shot whilst getting a better error message.
This is user friendlier and fixes the last installer "bug" on my list
wrt. disk encryption where hitting Enter twice at the passphrase prompt
would abort bioctl(8) and thus the installation.
OK deraadt
-/* $OpenBSD: bioctl.c,v 1.156 2023/10/06 09:55:02 kn Exp $ */
+/* $OpenBSD: bioctl.c,v 1.157 2023/10/07 12:20:10 kn Exp $ */
/*
* Copyright (c) 2004, 2005 Marco Peereboom
if (readpassphrase(prompt, passphrase, sizeof(passphrase),
rpp_flag) == NULL)
err(1, "unable to read passphrase");
+ if (*passphrase == '\0') {
+ warnx("invalid passphrase length");
+ if (interactive)
+ goto retry;
+ exit(1);
+ }
}
if (verify && !passfile) {