From dd81669f09789b3115a9fd0f0f51e9ac862ae9bc Mon Sep 17 00:00:00 2001 From: kn Date: Fri, 6 Oct 2023 09:55:02 +0000 Subject: [PATCH] rename pass{word -> file} variable It contains the path to the file containing a passphrase; password reads misleading and was also the only usage of "word" in contrast to consistent "phrase" usage. --- sbin/bioctl/bioctl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/bioctl/bioctl.c b/sbin/bioctl/bioctl.c index 9318fa10d2f..d84a701fdd6 100644 --- a/sbin/bioctl/bioctl.c +++ b/sbin/bioctl/bioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bioctl.c,v 1.155 2023/09/02 09:14:47 kn Exp $ */ +/* $OpenBSD: bioctl.c,v 1.156 2023/10/06 09:55:02 kn Exp $ */ /* * Copyright (c) 2004, 2005 Marco Peereboom @@ -90,7 +90,7 @@ int human; int verbose; u_int32_t cflags = 0; int rflag = -1; /* auto */ -char *password; +char *passfile; void *bio_cookie; @@ -175,7 +175,7 @@ main(int argc, char *argv[]) changepass = 1; break; case 'p': - password = optarg; + passfile = optarg; break; case 'r': if (strcmp(optarg, "auto") == 0) { @@ -1334,8 +1334,8 @@ derive_key(u_int32_t type, int rounds, u_int8_t *key, size_t keysz, errx(1, "number of KDF rounds is too small: %d", rounds); /* get passphrase */ - if (password) { - if ((f = fopen(password, "r")) == NULL) + if (passfile) { + if ((f = fopen(passfile, "r")) == NULL) err(1, "invalid passphrase file"); if (fstat(fileno(f), &sb) == -1) @@ -1363,7 +1363,7 @@ derive_key(u_int32_t type, int rounds, u_int8_t *key, size_t keysz, err(1, "unable to read passphrase"); } - if (verify && !password) { + if (verify && !passfile) { /* request user to re-type it */ if (readpassphrase("Re-type passphrase: ", verifybuf, sizeof(verifybuf), rpp_flag) == NULL) { -- 2.20.1