<div dir="ltr">Hey folks,<br><br>We've gained some optimizations for "pass init -e", "pass mv -e", and "pass cp -e". We now only reencrypt passwords for files that are encrypted with a different set of gpg ids than those specified in .gpg-id or elsewhere.<br>
<br>Here's the commit: <a href="http://git.zx2c4.com/password-store/commit/?id=ebd57647fa54721ec64aba47c79819ad270b3a63">http://git.zx2c4.com/password-store/commit/?id=ebd57647fa54721ec64aba47c79819ad270b3a63</a><br><br>
The relevant part is:<br><br><div><font face="courier new, monospace">set_gpg_recipients "$passfile_dir"</font></div><div><font face="courier new, monospace">[[ $prev_gpg_recipients != "${GPG_RECIPIENTS[@]}" ]] && \</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre"> </span>gpg_keys="$(gpg --list-keys --keyid-format long "${GPG_RECIPIENTS[@]}" | sed -n 's/sub *.*\/\([A-F0-9]\{16\}\) .*/\1/p' | sort | uniq)"</font></div>
<div><font face="courier new, monospace">current_keys="$($GPG -v --list-only --keyid-format long "$passfile" 2>&1 | cut -d ' ' -f 5 | sort | uniq)"</font></div><div><font face="courier new, monospace">if [[ $gpg_keys != "$current_keys" ]]; then</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre"> </span>echo "$passfile_display: reencrypting to ${gpg_keys//$'\n'/ }"</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre"> </span>$GPG -d $GPG_OPTS "$passfile" | $GPG -e "${GPG_RECIPIENT_ARGS[@]}" -o "$passfile.new.$fake_uniqueness_safety" $GPG_OPTS &&</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre"> </span>mv "$passfile.new.$fake_uniqueness_safety" "$passfile"</font></div><div><font face="courier new, monospace">fi</font></div>
<div><font face="courier new, monospace">prev_gpg_recipients="${GPG_RECIPIENTS[@]}"</font></div><div><br></div><div><br></div><div>That's prettttttyyy ugly, and perhaps prone to breaking, so if you feel motivated to test out this new code in a variety of settings, please do so.</div>
<div><br></div><div>Jason</div><span class=""></span><span class=""></span></div>