From 2742adaad38201278eebb61f94bb961e023b5fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sun, 3 Oct 2021 11:03:10 +0200 Subject: ksim/monitors/snmp: add AES privacy protocol, conditional build of DES privacy protocol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Andriot --- ksim/monitors/snmp/session.cpp | 7 +++++++ ksim/monitors/snmp/snmp.cpp | 3 ++- ksim/monitors/snmp/snmp.h | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'ksim') diff --git a/ksim/monitors/snmp/session.cpp b/ksim/monitors/snmp/session.cpp index 6839283..b52fe5c 100644 --- a/ksim/monitors/snmp/session.cpp +++ b/ksim/monitors/snmp/session.cpp @@ -186,9 +186,16 @@ bool Session::initialize( ErrorInfo *error ) } switch ( source.privacy.protocol ) { + case AESPrivacy: { + d->defaultSession.securityPrivProto = usmAESPrivProtocol; + d->defaultSession.securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN; + break; + } case DESPrivacy: { +#ifndef NETSNMP_DISABLE_DES d->defaultSession.securityPrivProto = usmDESPrivProtocol; d->defaultSession.securityPrivProtoLen = USM_PRIV_PROTO_DES_LEN; +#endif break; } default: assert( false ); diff --git a/ksim/monitors/snmp/snmp.cpp b/ksim/monitors/snmp/snmp.cpp index 333f0d2..1256228 100644 --- a/ksim/monitors/snmp/snmp.cpp +++ b/ksim/monitors/snmp/snmp.cpp @@ -48,7 +48,8 @@ static const struct EnumStringMapInfo { MD5Auth, "MD5", 0 }, { SHA1Auth, "SHA1", 0 }, { 0, 0, 0 } -}, privacyProtocolStrings[ 2 ] = { +}, privacyProtocolStrings[ 3 ] = { + { AESPrivacy, "AES", 0 }, { DESPrivacy, "DES", 0 }, { 0, 0, 0 } }; diff --git a/ksim/monitors/snmp/snmp.h b/ksim/monitors/snmp/snmp.h index c00e110..4b1e4fb 100644 --- a/ksim/monitors/snmp/snmp.h +++ b/ksim/monitors/snmp/snmp.h @@ -46,7 +46,10 @@ TQStringList allAuthenticationProtocols(); TQString authenticationProtocolToString( AuthenticationProtocol proto ); AuthenticationProtocol stringToAuthenticationProtocol( TQString string, bool *ok = 0 ); -enum PrivacyProtocol { DESPrivacy }; +enum PrivacyProtocol { + AESPrivacy, + DESPrivacy +}; TQStringList allPrivacyProtocols(); TQString privacyProtocolToString( PrivacyProtocol proto ); PrivacyProtocol stringToPrivacyProtocol( TQString string, bool *ok = 0 ); -- cgit v1.2.1