浏览代码

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 年之前
父节点
当前提交
3a6c3ce65c
共有 2 个文件被更改,包括 19 次插入1 次删除
  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,

文件差异内容过多而无法显示
+ 18 - 0
openpgp/keys_test.go


部分文件因为文件数量过多而无法显示