GPG2 ECDSA brainpool curve key not working #785

Closed
opened 2025-11-02 03:36:46 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @SoftwareMensch on GitHub (Jun 7, 2017).

Description

When I try to add my GPG2 armored pubkey, gitea says Sorry, we were not able to verify your GPG key: failed to parse gpg key openpgp: unsupported feature: invalid oid length: 9 . In my case I used the brainpoolP256r1 curve.

I'm really sure it's because ECDSA with a brainpool curve.

Screenshots

Issue

Originally created by @SoftwareMensch on GitHub (Jun 7, 2017). - Gitea version (or commit ref): 295f560 - Git version: 2.7.4 - Operating system: x86_64 GNU/Linux - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [X] Yes (https://try.gitea.io/user/settings/keys) - [ ] No - [ ] Not relevant ## Description When I try to add my GPG2 armored pubkey, gitea says `Sorry, we were not able to verify your GPG key: failed to parse gpg key openpgp: unsupported feature: invalid oid length: 9 `. In my case I used the `brainpoolP256r1` curve. I'm really sure it's because ECDSA with a brainpool curve. ## Screenshots [Issue](http://imgur.com/svXH8fK)
GiteaMirror added the type/bug label 2025-11-02 03:36:46 -06:00
Author
Owner

@sapk commented on GitHub (Jun 8, 2017):

Could you please provide a example of your public key failling or generate one with the same caracteristic that I could reproduce and add to testing (https://github.com/go-gitea/gitea/blob/master/models/gpg_key_test.go) ?

I think that it may be a type not suported by the lib used under.(https://godoc.org/golang.org/x/crypto/openpgp).

@sapk commented on GitHub (Jun 8, 2017): Could you please provide a example of your public key failling or generate one with the same caracteristic that I could reproduce and add to testing (https://github.com/go-gitea/gitea/blob/master/models/gpg_key_test.go) ? I think that it may be a type not suported by the lib used under.(https://godoc.org/golang.org/x/crypto/openpgp).
Author
Owner

@SoftwareMensch commented on GitHub (Jun 9, 2017):

Sure, this is such a key:

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2

mFMEV6HwkhMJKyQDAwIIAQEHAgMEUsvJO/j5dFMRRj67qeZC9fSKBsGZdOHRj2+6
8wssmbUuLTfT/ZjIbExETyY8hFnURRGpD2Ifyz0cKjXcbXfJtrQTRm9vYmFyIDxm
b29AYmFyLmRlPoh/BBMTCAAnBQJZOsDIAhsDBQkJZgGABQsJCAcCBhUICQoLAgQW
AgMBAh4BAheAAAoJEGuJTd/DBMzmNVQA/2beUrv1yU4gyvCiPDEm3pK42cSfaL5D
muCtPCUg9hlWAP4yq6M78NW8STfsXgn6oeziMYiHSTmV14nOamLuwwDWM7hXBFeh
8JISCSskAwMCCAEBBwIDBG3A+XfINAZp1CTse2mRNgeUE5DbUtEpO8ALXKA1UQsQ
DLKq27b7zTgawgXIGUGP6mWsJ5oH7MNAJ/uKTsYmX40DAQgHiGcEGBMIAA8FAleh
8JICGwwFCQlmAYAACgkQa4lN38MEzOZwKAD/QKyerAgcvzzLaqvtap3XvpYcw9tc
OyjLLnFQiVmq7kEA/0z0CQe3ZQiQIq5zrs7Nh1XRkFAo8GlU/SGC9XFFi722
=ZiSe
-----END PGP PUBLIC KEY BLOCK-----

Thank you in advance!

@SoftwareMensch commented on GitHub (Jun 9, 2017): Sure, this is such a key: ``` -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v2 mFMEV6HwkhMJKyQDAwIIAQEHAgMEUsvJO/j5dFMRRj67qeZC9fSKBsGZdOHRj2+6 8wssmbUuLTfT/ZjIbExETyY8hFnURRGpD2Ifyz0cKjXcbXfJtrQTRm9vYmFyIDxm b29AYmFyLmRlPoh/BBMTCAAnBQJZOsDIAhsDBQkJZgGABQsJCAcCBhUICQoLAgQW AgMBAh4BAheAAAoJEGuJTd/DBMzmNVQA/2beUrv1yU4gyvCiPDEm3pK42cSfaL5D muCtPCUg9hlWAP4yq6M78NW8STfsXgn6oeziMYiHSTmV14nOamLuwwDWM7hXBFeh 8JISCSskAwMCCAEBBwIDBG3A+XfINAZp1CTse2mRNgeUE5DbUtEpO8ALXKA1UQsQ DLKq27b7zTgawgXIGUGP6mWsJ5oH7MNAJ/uKTsYmX40DAQgHiGcEGBMIAA8FAleh 8JICGwwFCQlmAYAACgkQa4lN38MEzOZwKAD/QKyerAgcvzzLaqvtap3XvpYcw9tc OyjLLnFQiVmq7kEA/0z0CQe3ZQiQIq5zrs7Nh1XRkFAo8GlU/SGC9XFFi722 =ZiSe -----END PGP PUBLIC KEY BLOCK----- ``` Thank you in advance!
Author
Owner

@sapk commented on GitHub (Jun 9, 2017):

OK so after testing and some research, brainpoolP256r1 seems to not be in golang.org/x/crypto/openpgp but github.com/keybase/go-crypto implemented a patch keybase/go-crypto#18.

The keybase is a little off from origin but it is planned to update. When this happen we could use it as the gpg lib or wait that the "official" suupport this key type.

@sapk commented on GitHub (Jun 9, 2017): OK so after testing and some research, brainpoolP256r1 seems to not be in `golang.org/x/crypto/openpgp` but `github.com/keybase/go-crypto` implemented a patch keybase/go-crypto#18. The keybase is a little off from origin but it is planned to update. When this happen we could use it as the gpg lib or wait that the "official" suupport this key type.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#785