[Gnuk-users] Blue Pill factory-reset hangs

Erik Adler erik.adler at mensa.se
Sun Apr 2 23:48:51 UTC 2017


On 04/02/2017 06:36 PM, Paul Fertser wrote:
> On Sun, Apr 02, 2017 at 12:38:06PM +0200, Erik Adler wrote:
>> When I do a factory-reset in gpg  --card-edit I am asked if I am sure I
>> want to reset the device. I type “yes” and then the shell seems to hang.
>> Nothing is deleted from the Blue Pill and it is not reset. Everything
>> else seems to work fine.
> 
> Weird, I've just tried it and couldn't reproduce. Using GnuPG version
> 2.1.17 (scdaemon version matches of course), libgcrypt 1.7.3.
> 
> Can you please retry with that version and if you're still able to
> reproduce, could you provide more detailed instructions? I just
> generated keys on the device itself, then rebooted it few times, then
> did factory-reset and nothing hanged, the keys were gone.
> 

Thank you for your response.

STM32F103C8T6 (Blue Pill)
GNU/Linux 4.9.0-2-amd64 Debian testing
xfce4 4.12.3
bash 4.3.30
gnuk release/1.2.3 (git from today)
chopstx release/1.3 (from today)
gpg (GnuPG) 2.1.18
libgcrypt 1.7.6-beta
xfce4-terminal 0.8.3
openocd 0.9.0 with ST-Link V2
CPU x2 E5-2630 v3

./configure --vidpid=234b:0000 --target=BLUE_PILL --enable-factory-reset
Header file is: board-blue-pill.h
Debug option disabled
Configured for bare system (no-DFU)
PIN pad option disabled
CERT.3 Data Object is NOT supported
Card insert/removal by HID device is NOT supported
Life cycle management is supported

make

$ openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg \
          -c "program build/gnuk.elf verify reset exit"

$ openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg \
          -c init -c "reset halt" -c "stm32f1x lock 0" -c reset -c exit

$ openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg \
          -c init -c "reset halt" -c "stm32f1x options_read 0" -c reset
-c exit
Looks good.

$ nosetests -v --with-freshen
All tests pass!

I then generate some keys and put then on the gnuk.
I can see that they are there with gpg --card-status
I then try to do a factory reset as follows...

$ gpg --card-edit
gpg/card> admin
Admin commands are allowed

gpg/card> factory-reset
gpg: OpenPGP card no. D276000124010200FFFE671231360000 detected

gpg: Note: This command destroys all keys stored on the card!

Continue? (y/N) y
Really do a factory reset? (enter "yes") yes
---> hangs

Seems to hang in that the cursor never finishes the reset. After about
five minutes I kill the process. Doing a gpg --card-status shows nothing
is been deleted. This happens on all five of my Blue Pills.

Any ideas?

All the best

Erik Adler

-- 
GPG/PGP key ID: 0x2B4B58FE
gpg --keyserver pgp.mit.edu --recv-keys 0x2B4B58FE



More information about the gnuk-users mailing list