From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4619 invoked by alias); 12 Jun 2018 19:22:33 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42990 Received: (qmail 26108 invoked by uid 1010); 12 Jun 2018 19:22:33 -0000 X-Qmail-Scanner-Diagnostics: from mail-yw0-f193.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.161.193):SA:0(-1.7/5.0):. Processed in 1.3984 secs); 12 Jun 2018 19:22:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: phy1729@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=5wW/5j6TcqjEZiL4nGdTBTvl0ZDJaLpGENU3QfSfVws=; b=avVBVyVujQ4lk2wLwafDFGUNvOA+YOzIAafL7hBLkKCWBHU6jP57KoNlobCZXUYlHC BSrnfiqGO/YIS6/Wm3iVki7FMqbUEjtKm93jkBZmoKfob2h47/yJJEui7cCDjAoA0nTo DQx8Sxi9QBoyPjkLIwqemiG74IR20H1rsWFSxvJ542qo44hsHXdQLzgPelfXUI/tk4gw y/kVECe/wpSZIKtGls5MoMmjvS76WT0+MNuyaYH1drQmg1w9HjGNlr4pRfjsLiNJ2oV8 6cwPPXDm/KcXKHwspBP2oTEbnae3sCuuaZNWFptXC2sh+XaToPM/crVunW90zqoBBQnc kf5Q== X-Gm-Message-State: APt69E2+A8kKkk4ZUaZZsw3bGmnDtIM6NYFLn6Y33B/TO7eNB/IyF1UQ m4f2M9OfFvtNxBcTKc9ZgCsXTdMV X-Google-Smtp-Source: ADUXVKJ9+O9cMP4aUBQJYpxiOfofXIHA5W8JABPCcL6e7o+DuppHrKiGwYPksx5w1NYQXu8WezwSzw== X-Received: by 2002:a0d:f547:: with SMTP id e68-v6mr874665ywf.298.1528831348158; Tue, 12 Jun 2018 12:22:28 -0700 (PDT) Date: Tue, 12 Jun 2018 14:22:25 -0500 From: Matthew Martin To: zsh-workers@zsh.org Subject: Re: [PATCH] _gpg: Use explicit UIDs for public / secret keys. Message-ID: <20180612192223.GA74619@CptOrmolo.darkstar> Mail-Followup-To: zsh-workers@zsh.org References: <20180609200940.17041-1-doron.behar@gmail.com> <20180609203932.x3s4hbmbl6rtba76@tarpaulin.shahaf.local2> <20180612105457.wnuoenlfzapgosmf@NUC.doronbehar.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180612105457.wnuoenlfzapgosmf@NUC.doronbehar.com> User-Agent: Mutt/1.10.0 (2018-05-17) 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