Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] _gpg: Use explicit UIDs for public / secret keys.
- X-seq: zsh-workers 42990
- From: Matthew Martin <phy1729@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] _gpg: Use explicit UIDs for public / secret keys.
- Date: Tue, 12 Jun 2018 14:22:25 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5wW/5j6TcqjEZiL4nGdTBTvl0ZDJaLpGENU3QfSfVws=; b=HjXfodAhsqbtnlH+XZI1GKPe5EC6x/BJZyZBFiQkC8/IZc+lPVsV2OPw6zTcAcsbOU SkzScuIP45JiupWoQfOiNgzm75cma7qtocoSLuEnLZ1EQdFE0ro1k9aK26qGaE3Kvpux h4hFZcCifcmYStrr84elDt2HQyH6A4lGukPdK1QHxeqNb7VBW+fRSgUnsg+LqPaKycr5 Nz6jt8t37WzU+vPvhis9ZHieHOprS1S1NMs3U0TzYJMpQRABsEgJ2rNbY7gQupH0mrfO XP/Z1xh2H4poVVG7z96YWgaG51kK84V1zeJg2rZMLmTL8BVkYpC0agmbIDmj9bUUWeP9 ayVw==
- In-reply-to: <20180612105457.wnuoenlfzapgosmf@NUC.doronbehar.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20180609200940.17041-1-doron.behar@gmail.com> <20180609203932.x3s4hbmbl6rtba76@tarpaulin.shahaf.local2> <20180612105457.wnuoenlfzapgosmf@NUC.doronbehar.com>
On Tue, Jun 12, 2018 at 01:54:57PM +0300, Doron Behar wrote:
> Daniel,
>
> I would like you to tell me how can I solve better the `fpr` thing.
>
> To tell you the truth, I have no idea what `fpr` means. I just know, by
> comparing the output of `gpg --list-public-keys` with and without
> `--with-colons`, that the hexadecimal number afterwards is the actual
> key that needs to be used as an argument for these options. The way I
> understand it, only if there is an email address / description coming
> somewhere after the array element `fpr` (without another `fpr` in
> between), then this field is the description.
>
> Please tell me, how can this algorithm get better? I've had one idea in
> mind: Perhaps we can perform a more strict pattern matchings test before
> adding a uid for example?
Not a gpg user, but it seems like the documentation for the format is at
https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob_plain;f=doc/DETAILS
With regards to better parsing, you might consider something like
local line
for line in "${(@f)secret_keys}"; do
local parts=("${(@s,:,)line}")
if [[ $parts[1] == fpr ]]; then
...
This way only the first column in a line is checked for fpr and the
correct column can be used for the other values.
- Matthew Martin
Messages sorted by:
Reverse Date,
Date,
Thread,
Author