<html><head></head><body>Dear Mr. Niibe,<br>
<br>
Thank you for the explanation. I am now able to change the PIN. This is a very logical way to deal with the problem of the PIN being stored on the flash chip.<br>
<br>
Thanks again,<br>
Duncan<br><br><div class="gmail_quote">On 8 December 2016 11:47:07 pm GMT+00:00, NIIBE Yutaka <gniibe@fsij.org> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Duncan Guthrie <dguthrie@posteo.net> writes:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> I insert the device in my computer, and run "gpg --card-edit". I then<br /> type "admin" to enable more privileged commands, and select<br /> "passwd". I then select option 2, "unblock PIN", as directed by this<br /> page, <a href="https://wiki.debian.org/Smartcards/OpenPGP">https://wiki.debian.org/Smartcards/OpenPGP</a>, under the section<br /> "initialising the smartcard". I am prompted for the admin PIN, which<br /> is left as default and this is accepted.<br /><br /> However, any PIN I type in to change the PIN is always rejected, with<br /> the generic error message " general error".  Selecting the other<br /> options, such as "change PIN", yields the same result, albeit this<br /> option does not ask for the admin PIN, but the regular default PIN.<br /></blockquote><br />Sorry for your
inconvenience.<br /><br />This is the behaviour of Gnuk 1.2.  Changing user PIN is only possible<br />when private keys are installed (at least one key).  I should address<br />about this incompatible change more clearly.<br /><br />In Gnuk 1.0, user PIN information (hashed PIN) is recorded onto the<br />flash ROM on MCU until three private keys are registered.  So, it is<br />possible for Gnuk 1.0 to change user PIN with no private key.  On the<br />other hand, Gnuk 1.0 doesn't allow overriding key import (user needs to<br />delete keys by Gnuk specific tool, before installing new private key).<br /><br />In Gnuk 1.2, user PIN information is never recorded onto the flash ROM.<br />Authentication is done if encrypted private key can be successfully<br />decoded (or not).<br /><br />This breakage was introduced because I thought it is important to<br />support the use case with only one private key or two private keys<br />securely, allowing overriding key import.<br /><br />In Gnuk
1.0, I assumed that all users install three private keys onto<br />OpenPGPcard.  I realized that there are many users who don't so.<br /><br />Please stand with the factory setting of initial user PIN of 123456<br />until you install private keys (or generate them on token).  And only<br />after installing pravete keys, change user PIN.<br /><br />I know that developers should avoid this kind of breakage which needs to<br />change how user uses the software/device.  I tried to avoid, but I<br />couldn't find any good solution with no breakage.  Then, my choice was<br />(possibly acceptable) small breakage at the initial interaction, in<br />order to fix major security flaw in some known use cases.<br /><br />Well, let me explan the possible risk of Gnuk 1.0.  When a user only<br />install less than three private keys (one or two), the token has no<br />protection of private key(s) against invasive physical attacks to MCU.<br /><br /><blockquote class="gmail_quote" style="margin: 0pt
0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> Also of significance is that when running the tests in the " test"<br /> directory, these are all successful, however, in "tests" I get the<br /> following error:<br /></blockquote><br />Thanks for your report.  This is not related to the error you got.<br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> ============================= test session starts<hr />platform linux -- Python 3.4.2 -- py-1.4.25 -- pytest-2.6.3 collected 98 items test_empty_<a href="http://card.py">card.py</a> E<hr />ERRORS<hr />_________________________ ERROR at setup of test_login _________________________ pytest.fixture functions cannot use ``yield``. Instead write and return an inner function/generator and let the consumer call and iterate over it.: @pytest.fixture(scope="session") def card(): print() print("Test start!") reader = get_ccid_device()
print("Reader:", reader.get_string(1), reader.get_string(2)) card = OpenPGP_Card(reader) card.cmd_select_openpgp() yield card del card /home/user/gnuk/tests/<a href="conftest.py:9">conftest.py:9</a> !!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!! =========================== 1 error in 0.09 seconds ============================ <br /></blockquote><br />I guess that this is due to version difference of PyTest or Python.<br />I'll check the error and I will fix as this kind error suggested.</pre></blockquote></div><br>
-- <br>
Envoyé de mon appareil Android avec K-9 Mail. Veuillez excuser ma brièveté.</body></html>