Skip to content

Commit

Permalink
Fix typo in function name.
Browse files Browse the repository at this point in the history
  • Loading branch information
maraino committed May 17, 2022
1 parent 02ebcce commit 487ffed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions x509util/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (s Subject) Set(c *x509.Certificate) {
PostalCode: s.PostalCode,
SerialNumber: s.SerialNumber,
CommonName: s.CommonName,
ExtraNames: fromDistinguisedNames(s.ExtraNames),
ExtraNames: fromDistinguishedNames(s.ExtraNames),
}
}

Expand Down Expand Up @@ -138,7 +138,7 @@ func (i Issuer) Set(c *x509.Certificate) {
PostalCode: i.PostalCode,
SerialNumber: i.SerialNumber,
CommonName: i.CommonName,
ExtraNames: fromDistinguisedNames(i.ExtraNames),
ExtraNames: fromDistinguishedNames(i.ExtraNames),
}
}

Expand All @@ -164,10 +164,10 @@ func newExtraNames(atvs []pkix.AttributeTypeAndValue) []DistinguishedName {
return extraNames
}

// fromDistinguisedNames converts a list of DistinguisedName to
// fromDistinguishedNames converts a list of DistinguishedName to
// []pkix.AttributeTypeAndValue. Note that this method has a special case to
// encode the emailAddress deprecated field (1.2.840.113549.1.9.1).
func fromDistinguisedNames(dns []DistinguishedName) []pkix.AttributeTypeAndValue {
// encode the deprecated emailAddress field (1.2.840.113549.1.9.1).
func fromDistinguishedNames(dns []DistinguishedName) []pkix.AttributeTypeAndValue {
var atvs []pkix.AttributeTypeAndValue
for _, dn := range dns {
typ := asn1.ObjectIdentifier(dn.Type)
Expand Down
2 changes: 1 addition & 1 deletion x509util/name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ func Test_fromDistinguisedNames(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := fromDistinguisedNames(tt.args.dns); !reflect.DeepEqual(got, tt.want) {
if got := fromDistinguishedNames(tt.args.dns); !reflect.DeepEqual(got, tt.want) {
t.Errorf("fromDistinguisedNames() = %v, want %v", got, tt.want)
}
})
Expand Down

0 comments on commit 487ffed

Please sign in to comment.