SNMP++
3.3.11
|
Class that holds all authentication and privacy protocols for a snmp entity. More...
#include <auth_priv.h>
Public Member Functions | |
AuthPriv (int &construct_state) | |
Default constructor, initializes random values. More... | |
~AuthPriv () | |
Destructor, deletes all auth and priv protocol objets. More... | |
int | add_default_modules () |
Add the default authentication protocols. More... | |
int | add_auth (Auth *auth) |
Add a new authentication protocol. More... | |
int | del_auth (const int auth_id) |
Delete a authentication protocol. More... | |
int | add_priv (Priv *priv) |
Add a new privacy protocol. More... | |
int | del_priv (const int priv_id) |
Delete a privacy protocol. More... | |
int | password_to_key_auth (const int auth_prot, const unsigned char *password, const unsigned int password_len, const unsigned char *engine_id, const unsigned int engine_id_len, unsigned char *key, unsigned int *key_len) |
Call the password-to-key method of the specified authentication protocol. More... | |
int | password_to_key_priv (const int auth_prot, const int priv_prot, const unsigned char *password, const unsigned int password_len, const unsigned char *engine_id, const unsigned int engine_id_len, unsigned char *key, unsigned int *key_len) |
Call the password-to-key method of the specified privacy protocol. More... | |
int | get_keychange_value (const int auth_prot, const OctetStr &old_key, const OctetStr &new_key, OctetStr &keychange_value) |
Get the keyChange value for the specified keys using the given authentication protocol. More... | |
Priv * | get_priv (const int priv_prot) |
Get a pointer to a privacy protocol object. More... | |
Auth * | get_auth (const int auth_prot) |
Get a pointer to a authentication protocol object. More... | |
int | get_auth_id (const char *string_id) const |
Get the unique id for the given auth protocol. More... | |
int | get_priv_id (const char *string_id) const |
Get the unique id for the given priv protocol. More... | |
int | encrypt_msg (const int priv_prot, const unsigned char *key, const unsigned int key_len, const unsigned char *buffer, const unsigned int buffer_len, unsigned char *out_buffer, unsigned int *out_buffer_len, unsigned char *privacy_params, unsigned int *privacy_params_len, const unsigned long engine_boots, const unsigned long engine_time) |
Encrypt a message. More... | |
int | decrypt_msg (const int priv_prot, const unsigned char *key, const unsigned int key_len, const unsigned char *buffer, const unsigned int buffer_len, unsigned char *out_buffer, unsigned int *out_buffer_len, const unsigned char *privacy_params, const unsigned int privacy_params_len, const unsigned long engine_boots, const unsigned long engine_time) |
Decrypt a message. More... | |
int | get_auth_params_len (const int auth_prot) |
Get the length of the authentication parameters field of the given authentication protocol. More... | |
int | get_priv_params_len (const int priv_prot) |
Get the length of the privacy parameters field of the given privacy protocol. More... | |
int | auth_out_msg (const int auth_prot, const unsigned char *key, unsigned char *msg, const int msg_len, unsigned char *auth_par_ptr) |
Fill in the authentication field of an outgoing message. More... | |
int | auth_inc_msg (const int auth_prot, const unsigned char *key, unsigned char *msg, const int msg_len, unsigned char *auth_par_ptr, const int auth_par_len) |
Check the authentication field of an incoming message. More... | |
Private Attributes | |
AuthPtr * | auth |
Array of pointers to Auth-objects. More... | |
PrivPtr * | priv |
Array of pointers to Priv-objects. More... | |
int | auth_size |
current size of the auth array More... | |
int | priv_size |
current size of the priv array More... | |
pp_uint64 | salt |
current salt value (64 bits) More... | |
Class that holds all authentication and privacy protocols for a snmp entity.
Definition at line 343 of file auth_priv.h.
AuthPriv::AuthPriv | ( | int & | construct_state | ) |
Default constructor, initializes random values.
AuthPriv::~AuthPriv | ( | ) |
Destructor, deletes all auth and priv protocol objets.
int AuthPriv::add_auth | ( | Auth * | auth | ) |
Add a new authentication protocol.
All added objects will be deleted in the destructor
auth | - Pointer to a new auth protocol object |
int AuthPriv::add_default_modules | ( | ) |
Add the default authentication protocols.
The following authentication protocols are added:
The following privacy protocols are added:
int AuthPriv::add_priv | ( | Priv * | priv | ) |
Add a new privacy protocol.
All added objects will be deleted in the destructor
priv | - Pointer to a new privacy protocol object |
int AuthPriv::auth_inc_msg | ( | const int | auth_prot, |
const unsigned char * | key, | ||
unsigned char * | msg, | ||
const int | msg_len, | ||
unsigned char * | auth_par_ptr, | ||
const int | auth_par_len | ||
) |
Check the authentication field of an incoming message.
int AuthPriv::auth_out_msg | ( | const int | auth_prot, |
const unsigned char * | key, | ||
unsigned char * | msg, | ||
const int | msg_len, | ||
unsigned char * | auth_par_ptr | ||
) |
Fill in the authentication field of an outgoing message.
int AuthPriv::decrypt_msg | ( | const int | priv_prot, |
const unsigned char * | key, | ||
const unsigned int | key_len, | ||
const unsigned char * | buffer, | ||
const unsigned int | buffer_len, | ||
unsigned char * | out_buffer, | ||
unsigned int * | out_buffer_len, | ||
const unsigned char * | privacy_params, | ||
const unsigned int | privacy_params_len, | ||
const unsigned long | engine_boots, | ||
const unsigned long | engine_time | ||
) |
Decrypt a message.
int AuthPriv::del_auth | ( | const int | auth_id | ) |
Delete a authentication protocol.
auth_id | - The id of the authentication protocol to remove |
int AuthPriv::del_priv | ( | const int | priv_id | ) |
Delete a privacy protocol.
priv_id | - The id of the privacy protocol to remove |
int AuthPriv::encrypt_msg | ( | const int | priv_prot, |
const unsigned char * | key, | ||
const unsigned int | key_len, | ||
const unsigned char * | buffer, | ||
const unsigned int | buffer_len, | ||
unsigned char * | out_buffer, | ||
unsigned int * | out_buffer_len, | ||
unsigned char * | privacy_params, | ||
unsigned int * | privacy_params_len, | ||
const unsigned long | engine_boots, | ||
const unsigned long | engine_time | ||
) |
Encrypt a message.
Auth* AuthPriv::get_auth | ( | const int | auth_prot | ) |
Get a pointer to a authentication protocol object.
int AuthPriv::get_auth_id | ( | const char * | string_id | ) | const |
Get the unique id for the given auth protocol.
string_id | - The string returned by Auth::get_id_string() |
int AuthPriv::get_auth_params_len | ( | const int | auth_prot | ) |
Get the length of the authentication parameters field of the given authentication protocol.
int AuthPriv::get_keychange_value | ( | const int | auth_prot, |
const OctetStr & | old_key, | ||
const OctetStr & | new_key, | ||
OctetStr & | keychange_value | ||
) |
Get the keyChange value for the specified keys using the given authentication protocol.
Priv* AuthPriv::get_priv | ( | const int | priv_prot | ) |
Get a pointer to a privacy protocol object.
int AuthPriv::get_priv_id | ( | const char * | string_id | ) | const |
Get the unique id for the given priv protocol.
string_id | - The string returned by Priv::get_id_string() |
int AuthPriv::get_priv_params_len | ( | const int | priv_prot | ) |
Get the length of the privacy parameters field of the given privacy protocol.
int AuthPriv::password_to_key_auth | ( | const int | auth_prot, |
const unsigned char * | password, | ||
const unsigned int | password_len, | ||
const unsigned char * | engine_id, | ||
const unsigned int | engine_id_len, | ||
unsigned char * | key, | ||
unsigned int * | key_len | ||
) |
Call the password-to-key method of the specified authentication protocol.
int AuthPriv::password_to_key_priv | ( | const int | auth_prot, |
const int | priv_prot, | ||
const unsigned char * | password, | ||
const unsigned int | password_len, | ||
const unsigned char * | engine_id, | ||
const unsigned int | engine_id_len, | ||
unsigned char * | key, | ||
unsigned int * | key_len | ||
) |
Call the password-to-key method of the specified privacy protocol.
|
private |
Array of pointers to Auth-objects.
Definition at line 538 of file auth_priv.h.
|
private |
current size of the auth array
Definition at line 540 of file auth_priv.h.
|
private |
Array of pointers to Priv-objects.
Definition at line 539 of file auth_priv.h.
|
private |
current size of the priv array
Definition at line 541 of file auth_priv.h.
|
private |
current salt value (64 bits)
Definition at line 542 of file auth_priv.h.