diff options
Diffstat (limited to 'pysnmp/hlapi/v3arch/auth.py')
-rw-r--r-- | pysnmp/hlapi/v3arch/auth.py | 77 |
1 files changed, 45 insertions, 32 deletions
diff --git a/pysnmp/hlapi/v3arch/auth.py b/pysnmp/hlapi/v3arch/auth.py index 16363546..c4302d52 100644 --- a/pysnmp/hlapi/v3arch/auth.py +++ b/pysnmp/hlapi/v3arch/auth.py @@ -19,17 +19,7 @@ __all__ = [ 'USM_PRIV_CFB128_AES', 'USM_PRIV_CFB192_AES', 'USM_PRIV_CFB256_AES', 'USM_PRIV_CFB192_AES_BLUMENTHAL', 'USM_PRIV_CFB256_AES_BLUMENTHAL', 'USM_KEY_TYPE_PASSPHRASE', - 'USM_KEY_TYPE_MASTER', 'USM_KEY_TYPE_LOCALIZED', - # backward-compatible constants - 'usm3DESEDEPrivProtocol', 'usmAesCfb128Protocol', - 'usmAesCfb192Protocol', 'usmAesCfb256Protocol', - 'usmAesBlumenthalCfb192Protocol', 'usmAesBlumenthalCfb256Protocol', - 'usmDESPrivProtocol', 'usmHMACMD5AuthProtocol', - 'usmHMACSHAAuthProtocol', 'usmHMAC128SHA224AuthProtocol', - 'usmHMAC192SHA256AuthProtocol', 'usmHMAC256SHA384AuthProtocol', - 'usmHMAC384SHA512AuthProtocol', 'usmNoAuthProtocol', - 'usmNoPrivProtocol', 'usmKeyTypePassphrase', 'usmKeyTypeMaster', - 'usmKeyTypeLocalized' + 'USM_KEY_TYPE_MASTER', 'USM_KEY_TYPE_LOCALIZED' ] @@ -97,27 +87,6 @@ USM_KEY_TYPE_LOCALIZED = config.USM_KEY_TYPE_LOCALIZED """USM key material type - hashed pass-phrase hashed with Context SNMP Engine ID \ (:RFC:`3414#section-2.6`)""" -# Backward-compatible protocol IDs -usmNoAuthProtocol = USM_AUTH_NONE -usmHMACMD5AuthProtocol = USM_AUTH_HMAC96_MD5 -usmHMACSHAAuthProtocol = USM_AUTH_HMAC96_SHA -usmHMAC128SHA224AuthProtocol = USM_AUTH_HMAC128_SHA224 -usmHMAC192SHA256AuthProtocol = USM_AUTH_HMAC192_SHA256 -usmHMAC256SHA384AuthProtocol = USM_AUTH_HMAC256_SHA384 -usmHMAC384SHA512AuthProtocol = USM_AUTH_HMAC384_SHA512 -usmNoPrivProtocol = USM_PRIV_NONE -usmDESPrivProtocol = USM_PRIV_CBC56_DES -usm3DESEDEPrivProtocol = USM_PRIV_CBC168_3DES -usmAesCfb128Protocol = USM_PRIV_CFB128_AES -usmAesCfb192Protocol = USM_PRIV_CFB192_AES -usmAesCfb256Protocol = USM_PRIV_CFB256_AES -usmAesBlumenthalCfb192Protocol = USM_PRIV_CFB192_AES_BLUMENTHAL -usmAesBlumenthalCfb256Protocol = USM_PRIV_CFB256_AES_BLUMENTHAL - -usmKeyTypePassphrase = USM_KEY_TYPE_PASSPHRASE -usmKeyTypeMaster = USM_KEY_TYPE_MASTER -usmKeyTypeLocalized = USM_KEY_TYPE_LOCALIZED - class CommunityData(object): """Creates SNMP v1/v2c configuration entry. @@ -468,3 +437,47 @@ class UsmUserData(object): authKeyType is None and self.authKeyType or USM_KEY_TYPE_PASSPHRASE, privKeyType is None and self.privKeyType or USM_KEY_TYPE_PASSPHRASE ) + + +# Backward-compatible protocol IDs + +usmNoAuthProtocol = USM_AUTH_NONE +usmHMACMD5AuthProtocol = USM_AUTH_HMAC96_MD5 +usmHMACSHAAuthProtocol = USM_AUTH_HMAC96_SHA +usmHMAC128SHA224AuthProtocol = USM_AUTH_HMAC128_SHA224 +usmHMAC192SHA256AuthProtocol = USM_AUTH_HMAC192_SHA256 +usmHMAC256SHA384AuthProtocol = USM_AUTH_HMAC256_SHA384 +usmHMAC384SHA512AuthProtocol = USM_AUTH_HMAC384_SHA512 +usmNoPrivProtocol = USM_PRIV_NONE +usmDESPrivProtocol = USM_PRIV_CBC56_DES +usm3DESEDEPrivProtocol = USM_PRIV_CBC168_3DES +usmAesCfb128Protocol = USM_PRIV_CFB128_AES +usmAesCfb192Protocol = USM_PRIV_CFB192_AES +usmAesCfb256Protocol = USM_PRIV_CFB256_AES +usmAesBlumenthalCfb192Protocol = USM_PRIV_CFB192_AES_BLUMENTHAL +usmAesBlumenthalCfb256Protocol = USM_PRIV_CFB256_AES_BLUMENTHAL + +usmKeyTypePassphrase = USM_KEY_TYPE_PASSPHRASE +usmKeyTypeMaster = USM_KEY_TYPE_MASTER +usmKeyTypeLocalized = USM_KEY_TYPE_LOCALIZED + +__all__.extend( + ['usm3DESEDEPrivProtocol', + 'usmAesCfb128Protocol', + 'usmAesCfb192Protocol', + 'usmAesCfb256Protocol', + 'usmAesBlumenthalCfb192Protocol', + 'usmAesBlumenthalCfb256Protocol', + 'usmDESPrivProtocol', + 'usmHMACMD5AuthProtocol', + 'usmHMACSHAAuthProtocol', + 'usmHMAC128SHA224AuthProtocol', + 'usmHMAC192SHA256AuthProtocol', + 'usmHMAC256SHA384AuthProtocol', + 'usmHMAC384SHA512AuthProtocol', + 'usmNoAuthProtocol', + 'usmNoPrivProtocol', + 'usmKeyTypePassphrase', + 'usmKeyTypeMaster', + 'usmKeyTypeLocalized'] +)
\ No newline at end of file |