Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails if PGP .asc contains both public and private key blocks #32

Open
abrkn opened this issue Feb 14, 2020 · 6 comments
Open

Fails if PGP .asc contains both public and private key blocks #32

abrkn opened this issue Feb 14, 2020 · 6 comments

Comments

@abrkn
Copy link

abrkn commented Feb 14, 2020

Trying to do PGP key airdrop claim

hs-airdrop git:(master) ✗ bin/hs-airdrop ~/temp/xxxxx.asc 0xxxxxxxx hs1xxxx 0.01
Attempting to create proof.
This may take a bit.
Decrypting nonce...
AssertionError [ERR_ASSERTION]: Assertion failed.
    at findNonces (/Users/andreas/Repos/hs-airdrop/bin/hs-airdrop:256:3)
    at createKeyProofs (/Users/andreas/Repos/hs-airdrop/bin/hs-airdrop:328:23)
    at main (/Users/andreas/Repos/hs-airdrop/bin/hs-airdrop:746:14)

Why?

When a PGP key is exported from GPG (macOS) with the secret included, it looks like:

-----BEGIN PGP PUBLIC KEY BLOCK-----
...
-----END PGP PUBLIC KEY BLOCK-----
-----BEGIN PGP PRIVATE KEY BLOCK-----
...
-----END PGP PRIVATE KEY BLOCK-----

This tool cannot process the file.

Workaround

Remove the public key block and re-run command

@gg2001
Copy link

gg2001 commented Feb 14, 2020

For me on MacOS my PGP private key was above the public key, and hs-airdrop worked. It looked like this:

-----BEGIN PGP PRIVATE KEY BLOCK-----
...
-----END PGP PRIVATE KEY BLOCK-----
-----BEGIN PGP PUBLIC KEY BLOCK-----
...
-----END PGP PUBLIC KEY BLOCK-----

@boymanjor
Copy link
Contributor

@abrkn can we close this now?

@pinheadmz
Copy link
Member

@boymanjor I think we should leave this open until there is a fix in the code. I think future users will encounter this issue and find the workaround.

@skorokithakis
Copy link

Agreed, I was just bitten by this as well.

@Bashar
Copy link

Bashar commented Jul 6, 2021

my private key is on top with or without publickey at the bottom i get the error:
Error: Unknown private key type: PGP PRIVATE KEY BLOCK.

ubuntu linux

@arno01
Copy link

arno01 commented Jul 16, 2021

FWIW: for those having issues such as "Error: Could not find key for ID: ....", ...

move the exact key you need to sign the proof with, using gpg v1.x:

sudo apt -y install gnupg1
mkdir ~/.gnupg-TMP
gpg --export-secret-keys 0xYOURKEY | gpg1 --homedir ~/.gnupg-TMP --import
hs-airdrop ~/.gnupg-TMP/secring.gpg 0xYOURKEY hs1YOURADDRESS -f 0.5
## rm -rf or rather shred ~/.gnupg-TMP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants