diff options
author | Michael Muré <batolettre@gmail.com> | 2023-08-12 13:58:17 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2023-08-12 13:58:17 +0200 |
commit | 429b913dc5519babfab47bf65222e32415a6c1bd (patch) | |
tree | 9a39ab11d0373caeaf34f2d06188c481d27f67d7 /entities | |
parent | de8d2c139c8cddf5ba8b62186605deb6d8d46e72 (diff) | |
download | git-bug-429b913dc5519babfab47bf65222e32415a6c1bd.tar.gz |
fix openpgp handling to sign/check
Diffstat (limited to 'entities')
-rw-r--r-- | entities/identity/key.go | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/entities/identity/key.go b/entities/identity/key.go index 87271dd5..5ded31fa 100644 --- a/entities/identity/key.go +++ b/entities/identity/key.go @@ -217,18 +217,15 @@ func (k *Key) storePrivate(repo repository.RepoKeyring) error { } func (k *Key) PGPEntity() *openpgp.Entity { - uid := packet.NewUserId("", "", "") - return &openpgp.Entity{ + e := &openpgp.Entity{ PrimaryKey: k.public, PrivateKey: k.private, - Identities: map[string]*openpgp.Identity{ - uid.Id: { - Name: uid.Id, - UserId: uid, - SelfSignature: &packet.Signature{ - IsPrimaryId: func() *bool { b := true; return &b }(), - }, - }, - }, + Identities: map[string]*openpgp.Identity{}, + } + // somehow initialize the proper fields with identity, self-signature ... + err := e.AddUserId("name", "", "", nil) + if err != nil { + panic(err) } + return e } |