1#
2# This file is part of pyasn1-modules software.
3#
4# Created by Russ Housley with assistance from asn1ate v.0.6.0.
5#
6# Copyright (c) 2019, Vigil Security, LLC
7# License: http://snmplabs.com/pyasn1/license.html
8#
9# Certificate Extensions and Attributes Supporting Authentication
10#   in PPP and Wireless LAN Networks
11#
12# ASN.1 source from:
13# https://www.rfc-editor.org/rfc/rfc4334.txt
14#
15
16from pyasn1.type import constraint
17from pyasn1.type import univ
18
19from pyasn1_modules import rfc5280
20
21MAX = float('inf')
22
23
24# OID Arcs
25
26id_pe = univ.ObjectIdentifier('1.3.6.1.5.5.7.1')
27
28id_kp = univ.ObjectIdentifier('1.3.6.1.5.5.7.3')
29
30id_aca = univ.ObjectIdentifier('1.3.6.1.5.5.7.10')
31
32
33# Extended Key Usage Values
34
35id_kp_eapOverPPP = id_kp + (13, )
36
37id_kp_eapOverLAN = id_kp + (14, )
38
39
40# Wireless LAN SSID Extension
41
42id_pe_wlanSSID = id_pe + (13, )
43
44class SSID(univ.OctetString):
45    constraint.ValueSizeConstraint(1, 32)
46
47
48class SSIDList(univ.SequenceOf):
49    componentType = SSID()
50    subtypeSpec=constraint.ValueSizeConstraint(1, MAX)
51
52
53# Wireless LAN SSID Attribute Certificate Attribute
54
55id_aca_wlanSSID = id_aca + (7, )
56
57
58# Map of Certificate Extension OIDs to Extensions
59# To be added to the ones that are in rfc5280.py
60
61_certificateExtensionsMap = {
62    id_pe_wlanSSID: SSIDList(),
63}
64
65rfc5280.certificateExtensionsMap.update(_certificateExtensionsMap)
66
67
68# Map of AttributeType OIDs to AttributeValue added to the
69# ones that are in rfc5280.py
70
71_certificateAttributesMapUpdate = {
72    id_aca_wlanSSID: SSIDList(),
73}
74
75rfc5280.certificateAttributesMap.update(_certificateAttributesMapUpdate)
76