-.\" $OpenBSD: bioctl.8,v 1.111 2023/07/06 21:08:50 kn Exp $
+.\" $OpenBSD: bioctl.8,v 1.112 2023/08/18 14:09:19 kn Exp $
.\"
.\" Copyright (c) 2004, 2005 Marco Peereboom
.\"
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: July 6 2023 $
+.Dd $Mdocdate: August 18 2023 $
.Dt BIOCTL 8
.Os
.Sh NAME
based on system performance.
Otherwise the minimum is 4 rounds and the default is 16.
.It Fl s
-Read the passphrase for the selected crypto volume from
+Omit prompts and read passphrases without confirmation from
.Pa /dev/stdin
rather than
.Pa /dev/tty .
-/* $OpenBSD: bioctl.c,v 1.151 2022/10/18 07:04:20 kn Exp $ */
+/* $OpenBSD: bioctl.c,v 1.152 2023/08/18 14:09:19 kn Exp $ */
/*
* Copyright (c) 2004, 2005 Marco Peereboom
void *bio_cookie;
-int rpp_flag = RPP_REQUIRE_TTY;
+int interactive = 1;
int
main(int argc, char *argv[])
al_arg = optarg;
break;
case 's':
- rpp_flag = RPP_STDIN;
+ interactive = 0;
break;
case 't': /* patrol */
func |= BIOC_PATROL;
derive_key(kdfinfo->pbkdf.generic.type, kdfinfo->pbkdf.rounds,
kdfinfo->maskkey, sizeof(kdfinfo->maskkey),
kdfinfo->pbkdf.salt, sizeof(kdfinfo->pbkdf.salt),
- "New passphrase: ", 1);
+ "New passphrase: ", interactive);
}
int
size_t pl;
struct stat sb;
char passphrase[1024], verifybuf[1024];
+ int rpp_flag = RPP_ECHO_OFF;
if (!key)
errx(1, "Invalid key");
fclose(f);
} else {
+ rpp_flag |= interactive ? RPP_REQUIRE_TTY : RPP_STDIN;
+
if (readpassphrase(prompt, passphrase, sizeof(passphrase),
rpp_flag) == NULL)
err(1, "unable to read passphrase");