ERROR ImportKey error: openpgp: unsupported feature: hash for S2K function: 0
- Dominant language
- Go
- Stars
- 9.2k
- Forks
- 1.3k
- Avg merge
- 12h 58m
- Merged PRs (30d)
- 56
Description
I just playing with new v1.0 keybase client and I discovered that I cannot encrypt and sign messages using "keybase pgp" command.
NOTE: I have stored my PGP private key inside Yubikey token (smartcard). See https://www.esev.com/blog/post/2015-01-pgp-ssh-key-on-yubikey-neo/
The first symptoms are exactly the same as issue #1411 :
GPG tools sign without problems:
```
$ echo "hello" | gpg --sign --armour
-----BEGIN PGP MESSAGE-----
...
```
"keybase encrypt" is OK:
```
$ echo "hello" | keybase pgp encrypt
-----BEGIN PGP MESSAGE-----
Version: Keybase Go 1.0.9 (darwin)
Comment: https://keybase.io/download
...
```
and "keybase sign" is broken:
```
$ echo "hello" | keybase pgp sign
▶ ERROR No secret key available
```
BUT, when i tried solution from #1411, unfortunately it does not work...
```
keybase pgp select --only-import
# Algo Key Id Created UserId
= ==== ====== ======= ======
...
2 3072R 98421DBD09302131 Jan Stránský
...
Choose a key: 2
▶ ERROR ImportKey error: openpgp: unsupported feature: hash for S2K function: 0
```
What is wrong?
---
Additional info:
```
$ keybase --version
keybase version 1.0.9-0
```
```
$ gpg -K --fingerprint
-------------------------------------
sec# 3072R/09302131 2015-07-19 [expires: 2017-07-18]
Key fingerprint = E230 092B DE79 B552 74C0 7697 9842 1DBD 0930 2131
...
ssb> 2048R/087E660B 2015-07-19
ssb> 2048R/B0B9B199 2015-07-19
ssb> 2048R/2BD3645D 2015-07-19
```
```
$ gpg --edit-key 09302131
gpg (GnuPG/MacGPG2) 2.0.28; Copyright (C) 2015 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Secret key is available.
pub 3072R/09302131 created: 2015-07-19 expires: 2017-07-18 usage: C
trust: ultimate validity: ultimate
sub 2048R/087E660B created: 2015-07-19 expires: 2017-07-18 usage: E
sub 2048R/B0B9B199 created: 2015-07-19 expires: 2017-07-18 usage: S
sub 2048R/2BD3645D created: 2015-07-19 expires: 2017-07-18 usage: A
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the failure with the reported `keybase pgp select --only-import` and `keybase pgp sign` commands using a private key stored on a Yubikey. Start by tracing the PGP import and signing entry points; done means the key imports without the S2K error and signing succeeds, while preserving the working encryption behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cryptography, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100