aboutsummaryrefslogtreecommitdiffstats
path: root/entities
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2023-08-12 13:58:17 +0200
committerMichael Muré <batolettre@gmail.com>2023-08-12 13:58:17 +0200
commit429b913dc5519babfab47bf65222e32415a6c1bd (patch)
tree9a39ab11d0373caeaf34f2d06188c481d27f67d7 /entities
parentde8d2c139c8cddf5ba8b62186605deb6d8d46e72 (diff)
downloadgit-bug-429b913dc5519babfab47bf65222e32415a6c1bd.tar.gz
fix openpgp handling to sign/check
Diffstat (limited to 'entities')
-rw-r--r--entities/identity/key.go19
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
}