diff options
author | Ilya Etingof <etingof@gmail.com> | 2018-10-06 20:00:41 +0200 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2018-10-06 20:00:41 +0200 |
commit | 1315e5e9799caed8be6d2eabb8601b2b136a5238 (patch) | |
tree | 70f161ea5062504abe0d7be3c9999e60691774c1 | |
parent | 4cf3317ce9c818e3d9f8c11b662159479bf318b3 (diff) | |
download | pysnmp-git-1315e5e9799caed8be6d2eabb8601b2b136a5238.tar.gz |
Fix Sphinx markup for USM crypto algorithm IDs
-rw-r--r-- | docs/source/docs/api-reference.rst | 10 | ||||
-rw-r--r-- | pysnmp/entity/config.py | 2 | ||||
-rw-r--r-- | pysnmp/hlapi/__init__.py | 51 | ||||
-rw-r--r-- | pysnmp/hlapi/auth.py | 41 |
4 files changed, 88 insertions, 16 deletions
diff --git a/docs/source/docs/api-reference.rst b/docs/source/docs/api-reference.rst index 8ff7d958..d867db46 100644 --- a/docs/source/docs/api-reference.rst +++ b/docs/source/docs/api-reference.rst @@ -219,8 +219,7 @@ Security Model configuration for SNMP v3 systems. .. autoclass:: pysnmp.hlapi.UsmUserData(userName, authKey=None, privKey=None, authProtocol=usmNoAuthProtocol, privProtocol=usmNoPrivProtocol, securityEngineId=None) -Identification of Authentication and Privacy Protocols is done -via constant OIDs: +**Authentication protocol identifiers** .. autodata:: pysnmp.hlapi.usmNoAuthProtocol .. autodata:: pysnmp.hlapi.usmHMACMD5AuthProtocol @@ -230,6 +229,8 @@ via constant OIDs: .. autodata:: pysnmp.hlapi.usmHMAC256SHA384AuthProtocol .. autodata:: pysnmp.hlapi.usmHMAC384SHA512AuthProtocol +**Privacy (encryption) protocol identifiers** + .. autodata:: pysnmp.hlapi.usmNoPrivProtocol .. autodata:: pysnmp.hlapi.usmDESPrivProtocol .. autodata:: pysnmp.hlapi.usm3DESEDEPrivProtocol @@ -239,6 +240,11 @@ via constant OIDs: .. autodata:: pysnmp.hlapi.usmAesBlumenthalCfb192Protocol .. autodata:: pysnmp.hlapi.usmAesBlumenthalCfb256Protocol +.. note:: + + SNMP authentication and encryption keys must be at least *eight* + octets long. + Transport configuration is I/O framework specific and is described in respective sections. diff --git a/pysnmp/entity/config.py b/pysnmp/entity/config.py index bb7be0a3..e2ca92bb 100644 --- a/pysnmp/entity/config.py +++ b/pysnmp/entity/config.py @@ -28,7 +28,9 @@ usmHMAC128SHA224AuthProtocol = hmacsha2.HmacSha2.sha224ServiceID usmHMAC192SHA256AuthProtocol = hmacsha2.HmacSha2.sha256ServiceID usmHMAC256SHA384AuthProtocol = hmacsha2.HmacSha2.sha384ServiceID usmHMAC384SHA512AuthProtocol = hmacsha2.HmacSha2.sha512ServiceID + usmNoAuthProtocol = noauth.NoAuth.serviceID +"""No authentication service""" # Privacy protocol usmDESPrivProtocol = des.Des.serviceID diff --git a/pysnmp/hlapi/__init__.py b/pysnmp/hlapi/__init__.py index f60b0ed4..7a9c6371 100644 --- a/pysnmp/hlapi/__init__.py +++ b/pysnmp/hlapi/__init__.py @@ -7,9 +7,58 @@ from pysnmp.proto.rfc1902 import * from pysnmp.proto.rfc1905 import NoSuchInstance, NoSuchObject, EndOfMibView from pysnmp.smi.rfc1902 import * -from pysnmp.hlapi.auth import * +from pysnmp.hlapi import auth from pysnmp.hlapi.context import * from pysnmp.entity.engine import * # default is synchronous asyncore-based API from pysnmp.hlapi.asyncore.sync import * + + +CommunityData = auth.CommunityData +UsmUserData = auth.UsmUserData + +usmNoAuthProtocol = auth.usmNoAuthProtocol +"""No Authentication Protocol""" + +usmHMACMD5AuthProtocol = auth.usmHMACMD5AuthProtocol +"""The HMAC-MD5-96 Digest Authentication Protocol (:RFC:`3414#section-6`)""" + +usmHMACSHAAuthProtocol = auth.usmHMACSHAAuthProtocol +"""The HMAC-SHA-96 Digest Authentication Protocol AKA SHA-1 (:RFC:`3414#section-7`)""" + +usmHMAC128SHA224AuthProtocol = auth.usmHMAC128SHA224AuthProtocol +"""The HMAC-SHA-2 Digest Authentication Protocols (:RFC:`7860`)""" + +usmHMAC192SHA256AuthProtocol = auth.usmHMAC192SHA256AuthProtocol +"""The HMAC-SHA-2 Digest Authentication Protocols (:RFC:`7860`)""" + +usmHMAC256SHA384AuthProtocol = auth.usmHMAC256SHA384AuthProtocol +"""The HMAC-SHA-2 Digest Authentication Protocols (:RFC:`7860`)""" + +usmHMAC384SHA512AuthProtocol = auth.usmHMAC384SHA512AuthProtocol +"""The HMAC-SHA-2 Digest Authentication Protocols (:RFC:`7860`)""" + +usmNoPrivProtocol = auth.usmNoPrivProtocol +"""No Privacy Protocol""" + +usmDESPrivProtocol = auth.usmDESPrivProtocol +"""The CBC-DES Symmetric Encryption Protocol (:RFC:`3414#section-8`)""" + +usm3DESEDEPrivProtocol = auth.usm3DESEDEPrivProtocol +"""The 3DES-EDE Symmetric Encryption Protocol (`draft-reeder-snmpv3-usm-3desede-00 <https:://tools.ietf.org/html/draft-reeder-snmpv3-usm-3desede-00#section-5>`_)""" + +usmAesCfb128Protocol = auth.usmAesCfb128Protocol +"""The CFB128-AES-128 Symmetric Encryption Protocol (:RFC:`3826#section-3`)""" + +usmAesCfb192Protocol = auth.usmAesCfb192Protocol +"""The CFB128-AES-192 Symmetric Encryption Protocol (`draft-blumenthal-aes-usm-04 <https:://tools.ietf.org/html/draft-blumenthal-aes-usm-04#section-3>`_) with Reeder key localization""" + +usmAesCfb256Protocol = auth.usmAesCfb256Protocol +"""The CFB128-AES-256 Symmetric Encryption Protocol (`draft-blumenthal-aes-usm-04 <https:://tools.ietf.org/html/draft-blumenthal-aes-usm-04#section-3>`_) with Reeder key localization""" + +usmAesBlumenthalCfb192Protocol = auth.usmAesBlumenthalCfb192Protocol +"""The CFB128-AES-192 Symmetric Encryption Protocol (`draft-blumenthal-aes-usm-04 <https:://tools.ietf.org/html/draft-blumenthal-aes-usm-04#section-3>`_)""" + +usmAesBlumenthalCfb256Protocol = auth.usmAesBlumenthalCfb256Protocol +"""The CFB128-AES-256 Symmetric Encryption Protocol (`draft-blumenthal-aes-usm-04 <https:://tools.ietf.org/html/draft-blumenthal-aes-usm-04#section-3>`_)""" diff --git a/pysnmp/hlapi/auth.py b/pysnmp/hlapi/auth.py index e4650f4b..20db368f 100644 --- a/pysnmp/hlapi/auth.py +++ b/pysnmp/hlapi/auth.py @@ -151,35 +151,50 @@ class CommunityData(object): securityName is None and self.securityName or securityName ) - -#: No Authentication Protocol. usmNoAuthProtocol = config.usmNoAuthProtocol -#: The HMAC-MD5-96 Digest Authentication Protocol (:RFC:`3414#section-6`) +"""No Authentication Protocol""" + usmHMACMD5AuthProtocol = config.usmHMACMD5AuthProtocol -#: The HMAC-SHA-96 Digest Authentication Protocol (:RFC:`3414#section-7`) +"""The HMAC-MD5-96 Digest Authentication Protocol (:RFC:`3414#section-6`)""" + usmHMACSHAAuthProtocol = config.usmHMACSHAAuthProtocol -#: The HMAC-SHA-2 Digest Authentication Protocols (:RFC:`7860`) +"""The HMAC-SHA-96 Digest Authentication Protocol AKA SHA-1 (:RFC:`3414#section-7`)""" + usmHMAC128SHA224AuthProtocol = config.usmHMAC128SHA224AuthProtocol +"""The HMAC-SHA-2 Digest Authentication Protocols (:RFC:`7860`)""" + usmHMAC192SHA256AuthProtocol = config.usmHMAC192SHA256AuthProtocol +"""The HMAC-SHA-2 Digest Authentication Protocols (:RFC:`7860`)""" + usmHMAC256SHA384AuthProtocol = config.usmHMAC256SHA384AuthProtocol +"""The HMAC-SHA-2 Digest Authentication Protocols (:RFC:`7860`)""" + usmHMAC384SHA512AuthProtocol = config.usmHMAC384SHA512AuthProtocol +"""The HMAC-SHA-2 Digest Authentication Protocols (:RFC:`7860`)""" -#: No Privacy Protocol. usmNoPrivProtocol = config.usmNoPrivProtocol -#: The CBC-DES Symmetric Encryption Protocol (:RFC:`3414#section-8`) +"""No Privacy Protocol""" + usmDESPrivProtocol = config.usmDESPrivProtocol -#: The 3DES-EDE Symmetric Encryption Protocol (`draft-reeder-snmpv3-usm-3desede-00 <https://tools.ietf.org/html/draft-reeder-snmpv3-usm-3desede-00#section-5>`_) +"""The CBC-DES Symmetric Encryption Protocol (:RFC:`3414#section-8`)""" + usm3DESEDEPrivProtocol = config.usm3DESEDEPrivProtocol -#: The CFB128-AES-128 Symmetric Encryption Protocol (:RFC:`3826#section-3`) +"""The 3DES-EDE Symmetric Encryption Protocol (`draft-reeder-snmpv3-usm-3desede-00 <https:://tools.ietf.org/html/draft-reeder-snmpv3-usm-3desede-00#section-5>`_)""" + usmAesCfb128Protocol = config.usmAesCfb128Protocol -#: The CFB128-AES-192 Symmetric Encryption Protocol (`draft-blumenthal-aes-usm-04 <https://tools.ietf.org/html/draft-blumenthal-aes-usm-04#section-3>`_) with Reeder key localization +"""The CFB128-AES-128 Symmetric Encryption Protocol (:RFC:`3826#section-3`)""" + usmAesCfb192Protocol = config.usmAesCfb192Protocol -#: The CFB128-AES-256 Symmetric Encryption Protocol (`draft-blumenthal-aes-usm-04 <https://tools.ietf.org/html/draft-blumenthal-aes-usm-04#section-3>`_) with Reeder key localization +"""The CFB128-AES-192 Symmetric Encryption Protocol (`draft-blumenthal-aes-usm-04 <https:://tools.ietf.org/html/draft-blumenthal-aes-usm-04#section-3>`_) with Reeder key localization""" + usmAesCfb256Protocol = config.usmAesCfb256Protocol -#: The CFB128-AES-192 Symmetric Encryption Protocol (`draft-blumenthal-aes-usm-04 <https://tools.ietf.org/html/draft-blumenthal-aes-usm-04#section-3>`_) +"""The CFB128-AES-256 Symmetric Encryption Protocol (`draft-blumenthal-aes-usm-04 <https:://tools.ietf.org/html/draft-blumenthal-aes-usm-04#section-3>`_) with Reeder key localization""" + usmAesBlumenthalCfb192Protocol = config.usmAesBlumenthalCfb192Protocol -#: The CFB128-AES-256 Symmetric Encryption Protocol (`draft-blumenthal-aes-usm-04 <https://tools.ietf.org/html/draft-blumenthal-aes-usm-04#section-3>`_) +"""The CFB128-AES-192 Symmetric Encryption Protocol (`draft-blumenthal-aes-usm-04 <https:://tools.ietf.org/html/draft-blumenthal-aes-usm-04#section-3>`_)""" + usmAesBlumenthalCfb256Protocol = config.usmAesBlumenthalCfb256Protocol +"""The CFB128-AES-256 Symmetric Encryption Protocol (`draft-blumenthal-aes-usm-04 <https:://tools.ietf.org/html/draft-blumenthal-aes-usm-04#section-3>`_)""" class UsmUserData(object): |