diff -ruwpB zabbix-1.8.5/frontends/php/discoveryconf.php zabbix-1.8.5-snmp/frontends/php/discoveryconf.php --- zabbix-1.8.5/frontends/php/discoveryconf.php 2011-04-15 21:17:31.000000000 +0200 +++ zabbix-1.8.5-snmp/frontends/php/discoveryconf.php 2011-04-29 15:28:09.000000000 +0200 @@ -55,7 +55,7 @@ include_once('include/page_header.php'); 'new_check_ports'=> array(T_ZBX_PORTS, O_OPT, null, "validate_port_list({})&&", 'isset({add_check})'), 'new_check_key'=> array(T_ZBX_STR, O_OPT, null, null, 'isset({add_check})'), 'new_check_snmp_community'=> array(T_ZBX_STR, O_OPT, null, null, 'isset({add_check})'), - 'new_check_snmpv3_securitylevel'=> array(T_ZBX_INT, O_OPT, null, IN('0,1,2'), 'isset({add_check})'), + 'new_check_snmpv3_securitylevel'=> array(T_ZBX_INT, O_OPT, null, IN('0,1,2,3,4,5,6'), 'isset({add_check})'), 'new_check_snmpv3_securityname'=> array(T_ZBX_STR, O_OPT, null, null, 'isset({add_check})'), 'new_check_snmpv3_authpassphrase'=> array(T_ZBX_STR, O_OPT, null, null, 'isset({add_check})'), 'new_check_snmpv3_privpassphrase'=> array(T_ZBX_STR, O_OPT, null, null, 'isset({add_check})'), @@ -354,8 +354,12 @@ include_once('include/page_header.php'); $cmbSecLevel = new CComboBox('new_check_snmpv3_securitylevel', $new_check_snmpv3_securitylevel); $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_NOAUTHNOPRIV,'noAuthNoPriv'); - $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV,'authNoPriv'); - $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV,'authPriv'); + $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV,'authNoPriv MD5'); + $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV_SHA,'authNoPriv SHA'); + $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV,'authPriv MD5-DES'); + $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_MD5_AES,'authPriv MD5-AES'); + $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_DES,'authPriv SHA-DES'); + $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_AES,'authPriv SHA-AES'); $external_param->addRow(array(S_SNMPV3_SECURITY_LEVEL, $cmbSecLevel)); @@ -418,8 +422,12 @@ include_once('include/page_header.php'); // adding javascript, so that auth fields would be hidden if they are not used in specific auth type $securityLevelVisibility = array(); zbx_subarray_push($securityLevelVisibility, ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV, 'row_snmpv3_authpassphrase'); - zbx_subarray_push($securityLevelVisibility, ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV, 'row_snmpv3_authpassphrase'); - zbx_subarray_push($securityLevelVisibility, ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV, 'row_snmpv3_privpassphrase'); + zbx_subarray_push($securityLevelVisibility, ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV_SHA, 'row_snmpv3_authpassphrase'); + + foreach (array(ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV, ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_MD5_AES, ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_DES, ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_AES) as $authPrivLevel) { + zbx_subarray_push($securityLevelVisibility, $authPrivLevel, 'row_snmpv3_privpassphrase'); + zbx_subarray_push($securityLevelVisibility, $authPrivLevel, 'row_snmpv3_authpassphrase'); + } zbx_add_post_js("var securityLevelSwitcher = new CViewSwitcher('new_check_snmpv3_securitylevel', 'change', ".zbx_jsvalue($securityLevelVisibility, true).");"); } else{ diff -ruwpB zabbix-1.8.5/frontends/php/include/defines.inc.php zabbix-1.8.5-snmp/frontends/php/include/defines.inc.php --- zabbix-1.8.5/frontends/php/include/defines.inc.php 2011-04-15 21:17:30.000000000 +0200 +++ zabbix-1.8.5-snmp/frontends/php/include/defines.inc.php 2011-04-29 13:38:24.000000000 +0200 @@ -302,6 +302,10 @@ define('ITEM_SNMPV3_SECURITYLEVEL_NOAUTHNOPRIV', 0); define('ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV', 1); define('ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV', 2); + define('ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_MD5_AES', 3); + define('ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_DES', 4); + define('ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_AES', 5); + define('ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV_SHA', 6); define('ITEM_AUTHTYPE_PASSWORD', 0); define('ITEM_AUTHTYPE_PUBLICKEY', 1); diff -ruwpB zabbix-1.8.5/frontends/php/include/forms.inc.php zabbix-1.8.5-snmp/frontends/php/include/forms.inc.php --- zabbix-1.8.5/frontends/php/include/forms.inc.php 2011-04-15 21:17:30.000000000 +0200 +++ zabbix-1.8.5-snmp/frontends/php/include/forms.inc.php 2011-04-29 15:04:54.000000000 +0200 @@ -1727,8 +1727,12 @@ $cmbSecLevel = new CComboBox('snmpv3_securitylevel', $snmpv3_securitylevel); $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_NOAUTHNOPRIV,'noAuthNoPriv'); - $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV,'authNoPriv'); - $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV,'authPriv'); + $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV, 'authNoPriv MD5'); + $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV_SHA, 'authNoPriv SHA'); + $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV, 'authPriv MD5-DES'); + $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_MD5_AES,'authPriv MD5-AES'); + $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_DES,'authPriv SHA-DES'); + $cmbSecLevel->addItem(ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_AES,'authPriv SHA-AES'); $row = new CRow(array(new CCol(S_SNMPV3_SECURITY_LEVEL,'form_row_l'), new CCol($cmbSecLevel, 'form_row_r'))); $row->setAttribute('id', 'row_snmpv3_securitylevel'); @@ -1739,16 +1743,20 @@ $row = new CRow(array(new CCol(S_SNMPV3_AUTH_PASSPHRASE,'form_row_l'), new CCol(new CTextBox('snmpv3_authpassphrase',$snmpv3_authpassphrase,64), 'form_row_r'))); $row->setAttribute('id', 'row_snmpv3_authpassphrase'); $frmItem->addRow($row); - zbx_subarray_push($securityLevelVisibility, ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV, 'snmpv3_authpassphrase'); - zbx_subarray_push($securityLevelVisibility, ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV, 'row_snmpv3_authpassphrase'); + foreach (array(ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV, ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV_SHA) as $authPrivLevel) { + zbx_subarray_push($securityLevelVisibility, $authPrivLevel, 'snmpv3_authpassphrase'); + zbx_subarray_push($securityLevelVisibility, $authPrivLevel, 'row_snmpv3_authpassphrase'); + } $row = new CRow(array(new CCol(S_SNMPV3_PRIV_PASSPHRASE,'form_row_l'), new CCol(new CTextBox('snmpv3_privpassphrase',$snmpv3_privpassphrase,64), 'form_row_r'))); $row->setAttribute('id', 'row_snmpv3_privpassphrase'); $frmItem->addRow($row); - zbx_subarray_push($securityLevelVisibility, ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV, 'snmpv3_privpassphrase'); - zbx_subarray_push($securityLevelVisibility, ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV, 'row_snmpv3_privpassphrase'); - zbx_subarray_push($securityLevelVisibility, ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV, 'snmpv3_authpassphrase'); - zbx_subarray_push($securityLevelVisibility, ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV, 'row_snmpv3_authpassphrase'); + foreach (array(ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV, ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_MD5_AES, ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_DES, ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_AES) as $authPrivLevel) { + zbx_subarray_push($securityLevelVisibility, $authPrivLevel, 'snmpv3_privpassphrase'); + zbx_subarray_push($securityLevelVisibility, $authPrivLevel, 'row_snmpv3_privpassphrase'); + zbx_subarray_push($securityLevelVisibility, $authPrivLevel, 'snmpv3_authpassphrase'); + zbx_subarray_push($securityLevelVisibility, $authPrivLevel, 'row_snmpv3_authpassphrase'); + } $row = new CRow(array(new CCol(S_SNMP_PORT,'form_row_l'), new CCol(new CNumericBox('snmp_port',$snmp_port,5), 'form_row_r'))); $row->setAttribute('id', 'row_snmp_port'); diff -ruwpB zabbix-1.8.5/frontends/php/include/items.inc.php zabbix-1.8.5-snmp/frontends/php/include/items.inc.php --- zabbix-1.8.5/frontends/php/include/items.inc.php 2011-04-15 21:17:30.000000000 +0200 +++ zabbix-1.8.5-snmp/frontends/php/include/items.inc.php 2011-04-29 13:54:51.000000000 +0200 @@ -637,8 +637,18 @@ 'delta='.$item['delta'].','. 'snmpv3_securityname='.zbx_dbstr($item['snmpv3_securityname']).','. 'snmpv3_securitylevel='.$item['snmpv3_securitylevel'].','. - 'snmpv3_authpassphrase='.($item['snmpv3_securitylevel'] == ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV || $item['snmpv3_securitylevel'] == ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV ? zbx_dbstr($item['snmpv3_authpassphrase']) : "''").','. - 'snmpv3_privpassphrase='.($item['snmpv3_securitylevel'] == ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV ? zbx_dbstr($item['snmpv3_privpassphrase']) : "''").','. + 'snmpv3_authpassphrase='.($item['snmpv3_securitylevel'] == ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV + || $item['snmpv3_securitylevel'] == ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV + || $item['snmpv3_securitylevel'] == ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV_SHA + || $item['snmpv3_securitylevel'] == ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_AES + || $item['snmpv3_securitylevel'] == ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_DES + || $item['snmpv3_securitylevel'] == ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_MD5_AES + ? zbx_dbstr($item['snmpv3_authpassphrase']) : "''").','. + 'snmpv3_privpassphrase='.($item['snmpv3_securitylevel'] == ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV + || $item['snmpv3_securitylevel'] == ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_AES + || $item['snmpv3_securitylevel'] == ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_DES + || $item['snmpv3_securitylevel'] == ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_MD5_AES + ? zbx_dbstr($item['snmpv3_privpassphrase']) : "''").','. 'formula='.zbx_dbstr($item['formula']).','. 'trends='.$item['trends'].','. 'logtimefmt='.zbx_dbstr($item['logtimefmt']).','. diff -ruwpB zabbix-1.8.5/frontends/php/items.php zabbix-1.8.5-snmp/frontends/php/items.php --- zabbix-1.8.5/frontends/php/items.php 2011-04-15 21:17:31.000000000 +0200 +++ zabbix-1.8.5-snmp/frontends/php/items.php 2011-04-29 13:49:18.000000000 +0200 @@ -133,10 +133,22 @@ switch($itemType) { ITEM_TYPE_SNMPV2C.','. ITEM_TYPE_SNMPV3,'type')), - 'snmpv3_securitylevel'=>array(T_ZBX_INT, O_OPT, null, IN('0,1,2'), 'isset({save})&&(isset({type})&&({type}=='.ITEM_TYPE_SNMPV3.'))'), + 'snmpv3_securitylevel'=>array(T_ZBX_INT, O_OPT, null, IN('0,1,2,3,4,5,6'), 'isset({save})&&(isset({type})&&({type}=='.ITEM_TYPE_SNMPV3.'))'), 'snmpv3_securityname'=> array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&(isset({type})&&({type}=='.ITEM_TYPE_SNMPV3.'))'), - 'snmpv3_authpassphrase'=>array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&(isset({type})&&({type}=='.ITEM_TYPE_SNMPV3.')&&({snmpv3_securitylevel}=='.ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV.'||{snmpv3_securitylevel}=='.ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV.'))'), - 'snmpv3_privpassphrase'=>array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&(isset({type})&&({type}=='.ITEM_TYPE_SNMPV3.')&&({snmpv3_securitylevel}=='.ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV.'))'), + 'snmpv3_authpassphrase'=>array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&(isset({type})&&({type}=='.ITEM_TYPE_SNMPV3.')&&(' + .' {snmpv3_securitylevel}=='.ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV + .'||{snmpv3_securitylevel}=='.ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV_SHA + .'||{snmpv3_securitylevel}=='.ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV + .'||{snmpv3_securitylevel}=='.ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_MD5_AES + .'||{snmpv3_securitylevel}=='.ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_DES + .'||{snmpv3_securitylevel}=='.ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_AES + .'))'), + 'snmpv3_privpassphrase'=>array(T_ZBX_STR, O_OPT, null, null, 'isset({save})&&(isset({type})&&({type}=='.ITEM_TYPE_SNMPV3.')&&(' + .' {snmpv3_securitylevel}=='.ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV + .'||{snmpv3_securitylevel}=='.ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_MD5_AES + .'||{snmpv3_securitylevel}=='.ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_DES + .'||{snmpv3_securitylevel}=='.ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_AES + .'))'), 'ipmi_sensor'=> array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})&&(isset({type})&&({type}=='.ITEM_TYPE_IPMI.'))', S_IPMI_SENSOR), diff -ruwpB zabbix-1.8.5/include/common.h zabbix-1.8.5-snmp/include/common.h --- zabbix-1.8.5/include/common.h 2011-04-15 21:20:38.000000000 +0200 +++ zabbix-1.8.5-snmp/include/common.h 2011-04-29 14:10:01.000000000 +0200 @@ -262,6 +262,10 @@ const char *zbx_dservice_type_string(zbx #define ITEM_SNMPV3_SECURITYLEVEL_NOAUTHNOPRIV 0 #define ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV 1 #define ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV 2 +#define ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_MD5_AES 3 +#define ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_DES 4 +#define ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_AES 5 +#define ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV_SHA 6 /* Item multiplier types */ #define ITEM_MULTIPLIER_DO_NOT_USE 0 diff -ruwpB zabbix-1.8.5/src/zabbix_server/poller/checks_snmp.c zabbix-1.8.5-snmp/src/zabbix_server/poller/checks_snmp.c --- zabbix-1.8.5/src/zabbix_server/poller/checks_snmp.c 2011-04-15 21:17:29.000000000 +0200 +++ zabbix-1.8.5-snmp/src/zabbix_server/poller/checks_snmp.c 2011-04-29 14:28:50.000000000 +0200 @@ -234,40 +234,37 @@ static struct snmp_session *snmp_open_se session.securityName = item->snmpv3_securityname; session.securityNameLen = strlen(session.securityName); - /* set the security level to authenticated, but not encrypted */ - if (item->snmpv3_securitylevel == ITEM_SNMPV3_SECURITYLEVEL_NOAUTHNOPRIV) - { + /* set authentication key - if any */ + switch (item->snmpv3_securitylevel) { + case ITEM_SNMPV3_SECURITYLEVEL_NOAUTHNOPRIV: session.securityLevel = SNMP_SEC_LEVEL_NOAUTH; - } - else if (item->snmpv3_securitylevel == ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV) - { - session.securityLevel = SNMP_SEC_LEVEL_AUTHNOPRIV; + break; + + case ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV: + case ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV: + case ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_MD5_AES: /* set the authentication method to MD5 */ session.securityAuthProto = usmHMACMD5AuthProtocol; session.securityAuthProtoLen = USM_AUTH_PROTO_MD5_LEN; session.securityAuthKeyLen = USM_AUTH_KU_LEN; - if (SNMPERR_SUCCESS != generate_Ku(session.securityAuthProto, - session.securityAuthProtoLen, - (u_char *)item->snmpv3_authpassphrase, - strlen(item->snmpv3_authpassphrase), - session.securityAuthKey, - &session.securityAuthKeyLen)) - { - zbx_snprintf(err, MAX_STRING_LEN, "Error generating Ku from authentication pass phrase"); - goto end; - } - } - else if (item->snmpv3_securitylevel == ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV) - { - session.securityLevel = SNMP_SEC_LEVEL_AUTHPRIV; + break; - /* set the authentication method to MD5 */ - session.securityAuthProto = usmHMACMD5AuthProtocol; - session.securityAuthProtoLen = USM_AUTH_PROTO_MD5_LEN; + case ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV_SHA: + case ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_DES: + case ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_AES: + + /* set the authentication method to SHA1 */ + session.securityAuthProto = usmHMACSHA1AuthProtocol; + session.securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN; session.securityAuthKeyLen = USM_AUTH_KU_LEN; + break; + } + + if (session.securityLevel != SNMP_SEC_LEVEL_NOAUTH) + { if (SNMPERR_SUCCESS != generate_Ku(session.securityAuthProto, session.securityAuthProtoLen, (u_char *)item->snmpv3_authpassphrase, @@ -278,12 +275,47 @@ static struct snmp_session *snmp_open_se zbx_snprintf(err, MAX_STRING_LEN, "Error generating Ku from authentication pass phrase"); goto end; } + } + + /* set privacy key */ + switch (item->snmpv3_securitylevel) { + case ITEM_SNMPV3_SECURITYLEVEL_NOAUTHNOPRIV: + break; + + case ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV: + case ITEM_SNMPV3_SECURITYLEVEL_AUTHNOPRIV_SHA: + + session.securityLevel = SNMP_SEC_LEVEL_AUTHNOPRIV; + + break; + + case ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV: /* MD5_DES */ + case ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_DES: + + session.securityLevel = SNMP_SEC_LEVEL_AUTHPRIV; /* set the privacy method to DES */ session.securityPrivProto = usmDESPrivProtocol; session.securityPrivProtoLen = USM_PRIV_PROTO_DES_LEN; session.securityPrivKeyLen = USM_PRIV_KU_LEN; + break; + + case ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_MD5_AES: + case ITEM_SNMPV3_SECURITYLEVEL_AUTHPRIV_SHA_AES: + + session.securityLevel = SNMP_SEC_LEVEL_AUTHPRIV; + + /* set the privacy method to AES */ + session.securityPrivProto = usmAESPrivProtocol; + session.securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN; + session.securityPrivKeyLen = USM_PRIV_KU_LEN; + + break; + } + + if (session.securityLevel == SNMP_SEC_LEVEL_AUTHPRIV) + { if (SNMPERR_SUCCESS != generate_Ku(session.securityAuthProto, session.securityAuthProtoLen, (u_char *)item->snmpv3_privpassphrase,