Home GnuPG
Diffusion GnuPG 934864d399bb

scd: Enhance PASSWD command to accept KEYGRIP optionally.

Description

scd: Enhance PASSWD command to accept KEYGRIP optionally.

* scd/command.c (cmd_passwd): Handle KEYGRIP optionally.
  • GnuPG-bug-id: T5862
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Details

Provenance
gniibeAuthored on Mar 10 2022, 3:11 AM
Parents
rGd577ed295637: scd: Use same idiom for same work.
Branches
Unknown
Tags
Unknown
Tasks
T5862: authentication with USB token

Event Timeline

ikloecker added inline comments.
/scd/command.c
1623

The help text should probably explain how keygrip is used if it is given.

1654

I would have expected something like

while (*line && spacep (line))
  *line++ = 0;

to skip all whitespace instead of just a single whitespace character, but I see that
other code also doesn't skip multiple whitespace characters.

1657

This fails if the keygrip is followed by whitespace. It's unlikely, but parsing chvnostr is much more robust because it explicitly looks for 0x00 or whitespace instead of just looking for 0x00 as strlen does.

Thank you for your comment.

I'm going to add description string for KEYGRIP.

For other things, parsing these command lines are actually quite rough (in other places).
So, for now, I leave as it is.