rfc4334.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. from pyasn1.type import constraint
  16. from pyasn1.type import univ
  17. from pyasn1_modules import rfc5280
  18. MAX = float('inf')
  19. # OID Arcs
  20. id_pe = univ.ObjectIdentifier('1.3.6.1.5.5.7.1')
  21. id_kp = univ.ObjectIdentifier('1.3.6.1.5.5.7.3')
  22. id_aca = univ.ObjectIdentifier('1.3.6.1.5.5.7.10')
  23. # Extended Key Usage Values
  24. id_kp_eapOverPPP = id_kp + (13, )
  25. id_kp_eapOverLAN = id_kp + (14, )
  26. # Wireless LAN SSID Extension
  27. id_pe_wlanSSID = id_pe + (13, )
  28. class SSID(univ.OctetString):
  29. constraint.ValueSizeConstraint(1, 32)
  30. class SSIDList(univ.SequenceOf):
  31. componentType = SSID()
  32. subtypeSpec=constraint.ValueSizeConstraint(1, MAX)
  33. # Wireless LAN SSID Attribute Certificate Attribute
  34. id_aca_wlanSSID = id_aca + (7, )
  35. # Map of Certificate Extension OIDs to Extensions
  36. # To be added to the ones that are in rfc5280.py
  37. _certificateExtensionsMap = {
  38. id_pe_wlanSSID: SSIDList(),
  39. }
  40. rfc5280.certificateExtensionsMap.update(_certificateExtensionsMap)
  41. # Map of AttributeType OIDs to AttributeValue added to the
  42. # ones that are in rfc5280.py
  43. _certificateAttributesMapUpdate = {
  44. id_aca_wlanSSID: SSIDList(),
  45. }
  46. rfc5280.certificateAttributesMap.update(_certificateAttributesMapUpdate)