diff --git a/x509_cert/x509_utils.go b/x509_cert/x509_utils.go index ecf4aa1..523e163 100644 --- a/x509_cert/x509_utils.go +++ b/x509_cert/x509_utils.go @@ -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) { @@ -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 diff --git a/x509_cert/x509_utils_test.go b/x509_cert/x509_utils_test.go index d7e6987..5c4b016 100644 --- a/x509_cert/x509_utils_test.go +++ b/x509_cert/x509_utils_test.go @@ -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, }, {