NetBSD Problem Report #56127

From martin@aprisoft.de  Sun Apr 25 11:43:18 2021
Return-Path: <martin@aprisoft.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 064E61A9268
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 25 Apr 2021 11:43:17 +0000 (UTC)
Message-Id: <20210425114309.164165CC7A0@emmas.aprisoft.de>
Date: Sun, 25 Apr 2021 13:43:09 +0200 (CEST)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: netpgpkeys --generate-key --userid underdocumented/not working
X-Send-Pr-Version: 3.95

>Number:         56127
>Category:       bin
>Synopsis:       netpgpkeys --generate-key --userid underdocumented/not working
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 25 11:45:00 +0000 2021
>Last-Modified:  Sat May 01 14:45:01 +0000 2021
>Originator:     Martin Husemann
>Release:        NetBSD 9.99.82
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD martins.aprisoft.de 9.99.82 NetBSD 9.99.82 (GENERIC) #49: Sun Apr 25 07:23:50 CEST 2021 martin@martins.aprisoft.de:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:

I am trying to generate a special purpose gpg key which should carry
a special user id as marker for its purpose - but I failed to make
netpgpkeys --generate-key to create anything but "martin@localhost"
as user id.

There is no example for the --userid option in the man page and it
just seems to be ignored.

>How-To-Repeat:
s/a
>Fix:
n/a

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/56127: netpgpkeys not working
Date: Sat, 1 May 2021 16:43:34 +0200

 Here is a patch that seems to get the userid into the key at generation
 time, but I still can't list keys or use them to verify/sign.

 Martin

 Index: src/netpgpkeys/netpgpkeys.c
 ===================================================================
 RCS file: /cvsroot/src/crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.c,v
 retrieving revision 1.27
 diff -u -p -r1.27 netpgpkeys.c
 --- src/netpgpkeys/netpgpkeys.c	13 Nov 2018 14:52:30 -0000	1.27
 +++ src/netpgpkeys/netpgpkeys.c	1 May 2021 14:37:46 -0000
 @@ -222,6 +222,8 @@ netpgp_cmd(netpgp_t *netpgp, prog_t *p, 
  	case IMPORT_KEY:
  		return netpgp_import_key(netpgp, f);
  	case GENERATE_KEY:
 +		if (f == NULL)
 +			f = netpgp_getvar(netpgp, "userid");
  		return netpgp_generate_key(netpgp, f, p->numbits);
  	case GET_KEY:
  		key = netpgp_get_key(netpgp, f, netpgp_getvar(netpgp, "format"));

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.