Webserver+3d print

Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

snmp_usm.c File Reference

snmp_usm.c File Reference

User-based Security Model (USM) for SNMPv3. More...

Go to the source code of this file.

Functions

error_t snmpGenerateKey (SnmpAuthProtocol authProtocol, const char_t *password, const uint8_t *engineId, size_t engineIdLen, SnmpKey *key)
 Password to key algorithm.
error_t snmpCheckSecurityParameters (const SnmpUserInfo *user, SnmpMessage *message, const uint8_t *engineId, size_t engineIdLen)
 Check security parameters.
error_t snmpAuthOutgoingMessage (const SnmpUserInfo *user, SnmpMessage *message)
 Authenticate outgoing SNMP message.
error_t snmpAuthIncomingMessage (const SnmpUserInfo *user, SnmpMessage *message)
 Authenticate incoming SNMP message.
error_t snmpEncryptData (const SnmpUserInfo *user, SnmpMessage *message, uint64_t *salt)
 Data encryption.
error_t snmpDecryptData (const SnmpUserInfo *user, SnmpMessage *message)
 Data decryption.

Detailed Description

User-based Security Model (USM) for SNMPv3.

License

Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Description

This module implements the User-based Security Model (USM) for Simple Network Management Protocol (SNMP) version 3. Refer to the following RFCs for complete details:

  • RFC 3414: User-based Security Model (USM) for SNMPv3
  • RFC 3826: AES Cipher Algorithm in the SNMP User-based Security Model
  • RFC 7860: HMAC-SHA-2 Authentication Protocols in the User-based Security Model
Author:
Oryx Embedded SARL (www.oryx-embedded.com)
Version:
1.7.6

Definition in file snmp_usm.c.


Function Documentation

error_t snmpAuthIncomingMessage ( const SnmpUserInfo user,
SnmpMessage message 
)

Authenticate incoming SNMP message.

Parameters:
[in]userSecurity profile of the user
[in]messagePointer to the incoming SNMP message
Returns:
Error code

Definition at line 339 of file snmp_usm.c.

error_t snmpAuthOutgoingMessage ( const SnmpUserInfo user,
SnmpMessage message 
)

Authenticate outgoing SNMP message.

Parameters:
[in]userSecurity profile of the user
[in,out]messagePointer to the outgoing SNMP message
Returns:
Error code

Definition at line 237 of file snmp_usm.c.

error_t snmpCheckSecurityParameters ( const SnmpUserInfo user,
SnmpMessage message,
const uint8_t *  engineId,
size_t  engineIdLen 
)

Check security parameters.

Parameters:
[in]userSecurity profile of the user
[in,out]messagePointer to the incoming SNMP message
[in]engineIdPointer to the authoritative engine ID
[in]engineIdLenLength of the authoritative engine ID
Returns:
Error code

Definition at line 190 of file snmp_usm.c.

error_t snmpDecryptData ( const SnmpUserInfo user,
SnmpMessage message 
)

Data decryption.

Parameters:
[in]userSecurity profile of the user
[in,out]messagePointer to the incoming SNMP message
Returns:
Error code

Definition at line 594 of file snmp_usm.c.

error_t snmpEncryptData ( const SnmpUserInfo user,
SnmpMessage message,
uint64_t *  salt 
)

Data encryption.

Parameters:
[in]userSecurity profile of the user
[in,out]messagePointer to the outgoing SNMP message
[in,out]saltPointer to the salt integer
Returns:
Error code

Definition at line 455 of file snmp_usm.c.

error_t snmpGenerateKey ( SnmpAuthProtocol  authProtocol,
const char_t *  password,
const uint8_t *  engineId,
size_t  engineIdLen,
SnmpKey key 
)

Password to key algorithm.

Parameters:
[in]authProtocolAuthentication protocol (MD5 or SHA-1)
[in]passwordNULL-terminated string that contains the password
[in]engineIdPointer to the engine ID
[in]engineIdLenLength of the engine ID
[out]keyPointer to the resulting key
Returns:
Error code

Definition at line 77 of file snmp_usm.c.