Browse Source

openpgp: correct NewEntity name creation

Confusingly, `Identity.Name` should actually refer to `uid.Id` and not
`uid.Name`. This fixes the code in NewEntity, and creates a test case to
verify.

Change-Id: Id46de876fc7b0359faecfeb9b09a8e454710d485
Reviewed-on: https://go-review.googlesource.com/92595
Reviewed-by: Adam Langley <agl@golang.org>
Yaron de Leeuw 7 years ago
parent
commit
3a6c3ce65c
2 changed files with 19 additions and 1 deletions
  1. 1 1
      openpgp/keys.go
  2. 18 0
      openpgp/keys_test.go

+ 1 - 1
openpgp/keys.go

@@ -486,7 +486,7 @@ func NewEntity(name, comment, email string, config *packet.Config) (*Entity, err
 	}
 	isPrimaryId := true
 	e.Identities[uid.Id] = &Identity{
-		Name:   uid.Name,
+		Name:   uid.Id,
 		UserId: uid,
 		SelfSignature: &packet.Signature{
 			CreationTime: currentTime,

File diff suppressed because it is too large
+ 18 - 0
openpgp/keys_test.go


Some files were not shown because too many files changed in this diff