<div dir="ltr">Peter, that's a pretty wacky design decision. Thanks for spelling it out for me. Next time I set up a new key, I'll verify that this was in fact the issue. Meanwhile, I hope that our record of this discussion rescues another person from an exasperating experience in the future!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 30, 2019 at 3:07 AM Peter Lebbing <<a href="mailto:peter@digitalbrains.com">peter@digitalbrains.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I think your new password is now "78thisismypassword".<br>
<br>
There's an annoying design deficiency in the OpenPGP Card<br>
specification. It says this:<br>
<br>
> The length of the existing password is known in the card, so that<br>
> neither a delimiter nor padding for filling up fixed formats is<br>
> necessary for UTF-8. The length of the new UTF-8 password therefore<br>
> computes L new = Lc – L old.<br>
<br>
Do you see the problem? :-)<br>
<br>
The data field for changing OLDPIN to NEWPIN is formatted as:<br>
<br>
OLDPINNEWPIN<br>
<br>
The data field that is sent when you specify the old PIN as OLDPINBAD<br>
and the new PIN as NEWPIN is:<br>
<br>
OLDPINBADNEWPIN<br>
<br>
So the pin is changed to BADNEWPIN.<br>
<br>
So any suffix you accidentally add to the old PIN becomes a prefix to<br>
the new PIN.<br>
<br>
This is in the specification, not the GnuK implementation :-(.<br>
<br>
And the mistake in the reasoning of the specification is that even<br>
though the card might be completely certain of the length of the old<br>
PIN, the user might not be. Add default PINs that only differ in suffix,<br>
and we get a trap sprung for the unsuspecting user.<br>
<br>
HTH,<br>
<br>
Peter.<br>
<br>
-- <br>
I use the GNU Privacy Guard (GnuPG) in combination with Enigmail.<br>
You can send me encrypted mail if you want some privacy.<br>
My key is available at <<a href="http://digitalbrains.com/2012/openpgp-key-peter" rel="noreferrer" target="_blank">http://digitalbrains.com/2012/openpgp-key-peter</a>><br>
<br>
</blockquote></div>