On Fri, Aug 18, 2023 at 10:35:37AM +0200, Omar Polo wrote:
> sorry for the noise, noticed just now re-reading the diff.
> 
> On 2023/08/17 09:32:43 +0000, Klemens Nanni <k...@openbsd.org> wrote:
> > --- bioctl.8        6 Jul 2023 21:08:50 -0000       1.111
> > +++ bioctl.8        17 Aug 2023 09:24:28 -0000
> > @@ -288,7 +288,7 @@ is specified as "auto", the number of ro
> >  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 .
> 
> "read passphrases" hints that it reads more than one, which is not
> what it would do now.

Since -s applies to -P, it does effect multiple passphrases in one usage,
i.e. you enter an old and a new one.

The plural also reads more generic, less specific to me.

> 
> what about something like
> 
> +Read the passphrase from standard input without prompting.

So which one does "the" refer to, old or new one?

I'll commit the manual text as-is now, since that it is already an
improvement;  we can polish in-tree.

> 
> I'm not sure how to fit "without confirmation" nicely and whether the
> singular "passphrase" is enough to convey what it does.
> 
> 
> also, to correct my previous mail
> 
> On 2023/08/17 16:28:52 +0200, Omar Polo <o...@omarpolo.com> wrote:
> > On 2023/08/17 09:32:43 +0000, Klemens Nanni <k...@openbsd.org> wrote:
> > > [...]
> > > @@ -1316,6 +1316,7 @@ derive_key(u_int32_t type, int rounds, u
> > >   size_t          pl;
> > >   struct stat     sb;
> > >   char            passphrase[1024], verifybuf[1024];
> > > + int             rpp_flag = RPP_ECHO_OFF;
> > 
> > since this is the default...
> > 
> > >   if (!key)
> > >           errx(1, "Invalid key");
> > > @@ -1351,6 +1352,8 @@ derive_key(u_int32_t type, int rounds, u
> > >  
> > >           fclose(f);
> > >   } else {
> > > +         rpp_flag |= interactive ? RPP_REQUIRE_TTY : RPP_STDIN;
> > > +
> > 
> > I'd find slightly easier to read
> > 
> > +           rpp_flag = interactive ? RPP_REQUIRE_TTY : RPP_STDIN
> > 
> > but no strong opinion.
> 
> obviously i meant for this line to be moved earlier in my suggestion.

Also works, but I think jsing has a point here, where XOR'ing the value
makes it clearer how rpp_flag works.

This also matches signify(1)'s code around readpassphrase(3).

> 
> > >           if (readpassphrase(prompt, passphrase, sizeof(passphrase),
> > >               rpp_flag) == NULL)
> > >                   err(1, "unable to read passphrase");
> 

Reply via email to