github.com/zmap/zlint@v1.1.0/util/ev.go (about)

     1  /*
     2   * ZLint Copyright 2018 Regents of the University of Michigan
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License"); you may not
     5   * use this file except in compliance with the License. You may obtain a copy
     6   * of the License at http://www.apache.org/licenses/LICENSE-2.0
     7   *
     8   * Unless required by applicable law or agreed to in writing, software
     9   * distributed under the License is distributed on an "AS IS" BASIS,
    10   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    11   * implied. See the License for the specific language governing
    12   * permissions and limitations under the License.
    13   */
    14  
    15  package util
    16  
    17  import (
    18  	"encoding/asn1"
    19  )
    20  
    21  var evoids = map[string]bool{
    22  	"1.3.159.1.17.1":                   true,
    23  	"1.3.6.1.4.1.34697.2.1":            true,
    24  	"1.3.6.1.4.1.34697.2.2":            true,
    25  	"1.3.6.1.4.1.34697.2.3":            true,
    26  	"1.3.6.1.4.1.34697.2.4":            true,
    27  	"1.2.40.0.17.1.22":                 true,
    28  	"2.16.578.1.26.1.3.3":              true,
    29  	"1.3.6.1.4.1.17326.10.14.2.1.2":    true,
    30  	"1.3.6.1.4.1.17326.10.8.2.1.2":     true,
    31  	"1.3.6.1.4.1.6449.1.2.1.5.1":       true,
    32  	"2.16.840.1.114412.2.1":            true,
    33  	"2.16.840.1.114412.1.3.0.2":        true,
    34  	"2.16.528.1.1001.1.1.1.12.6.1.1.1": true,
    35  	"2.16.792.3.0.4.1.1.4":             true,
    36  	"2.16.840.1.114028.10.1.2":         true,
    37  	"0.4.0.2042.1.4":                   true,
    38  	"0.4.0.2042.1.5":                   true,
    39  	"1.3.6.1.4.1.13177.10.1.3.10":      true,
    40  	"1.3.6.1.4.1.14370.1.6":            true,
    41  	"1.3.6.1.4.1.4146.1.1":             true,
    42  	"2.16.840.1.114413.1.7.23.3":       true,
    43  	"1.3.6.1.4.1.14777.6.1.1":          true,
    44  	"2.16.792.1.2.1.1.5.7.1.9":         true,
    45  	"1.3.6.1.4.1.782.1.2.1.8.1":        true,
    46  	"1.3.6.1.4.1.22234.2.5.2.3.1":      true,
    47  	"1.3.6.1.4.1.8024.0.2.100.1.2":     true,
    48  	"1.2.392.200091.100.721.1":         true,
    49  	"2.16.840.1.114414.1.7.23.3":       true,
    50  	"1.3.6.1.4.1.23223.2":              true,
    51  	"1.3.6.1.4.1.23223.1.1.1":          true,
    52  	"2.16.756.1.83.21.0":               true,
    53  	"2.16.756.1.89.1.2.1.1":            true,
    54  	"1.3.6.1.4.1.7879.13.24.1":         true,
    55  	"2.16.840.1.113733.1.7.48.1":       true,
    56  	"2.16.840.1.114404.1.1.2.4.1":      true,
    57  	"2.16.840.1.113733.1.7.23.6":       true,
    58  	"1.3.6.1.4.1.6334.1.100.1":         true,
    59  	"2.16.840.1.114171.500.9":          true,
    60  	"1.3.6.1.4.1.36305.2":              true,
    61  }
    62  
    63  // IsEV returns true if the input is a known Extended Validation OID.
    64  func IsEV(in []asn1.ObjectIdentifier) bool {
    65  	for _, oid := range in {
    66  		if _, ok := evoids[oid.String()]; ok {
    67  			return true
    68  		}
    69  	}
    70  	return false
    71  }