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>
This commit is contained in:
Yaron de Leeuw
2018-02-13 22:19:55 +00:00
committed by Adam Langley
parent 9de5f2eaf7
commit 3a6c3ce65c
2 changed files with 19 additions and 1 deletions
+1 -1
View File
@@ -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,