Skip to content

Commit

Permalink
Refactor constant name SAN_TYPE_OTHER_NAME to SanTypeOtherName
Browse files Browse the repository at this point in the history
Updated the constant name to follow Go naming conventions, improving code readability and consistency. Adjusted references in both `x509_utils.go` and its corresponding test file to ensure proper functionality.
  • Loading branch information
rolandgroen committed Nov 1, 2024
1 parent fb97cfd commit 296bd1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions x509_cert/x509_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type SanType pkix.AttributeTypeAndValue
type SanTypeName string

const (
SAN_TYPE_OTHER_NAME SanTypeName = "otherName"
SanTypeOtherName SanTypeName = "otherName"
)

func FindOtherName(certificate *x509.Certificate) (string, SanTypeName, error) {
Expand All @@ -31,7 +31,7 @@ func FindOtherName(certificate *x509.Certificate) (string, SanTypeName, error) {
return "", "", err
}
if otherNameValue != "" {
return otherNameValue, SAN_TYPE_OTHER_NAME, nil
return otherNameValue, SanTypeOtherName, nil
}
err = errors.New("no otherName found in the SAN attributes, please check if the certificate is an UZI Server Certificate")
return "", "", err
Expand Down
2 changes: 1 addition & 1 deletion x509_cert/x509_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestFindOtherName(t *testing.T) {
name: "ValidOtherName",
certificate: chain[0],
wantName: "2.16.528.1.1007.99.2110-1-900030787-S-90000380-00.000-11223344",
wantType: SAN_TYPE_OTHER_NAME,
wantType: SanTypeOtherName,
wantErr: false,
},
{
Expand Down

0 comments on commit 296bd1a

Please sign in to comment.