ccRTP 2.1.2
|
ZRTP configuration data. More...
#include <ZrtpConfigure.h>
Public Member Functions | |
ZrtpConfigure () | |
~ZrtpConfigure () | |
void | setStandardConfig () |
Convenience function that sets a pre-defined standard configuration. More... | |
void | setMandatoryOnly () |
Convenience function that sets the mandatory algorithms only. More... | |
void | clear () |
Clear all configuration data. More... | |
int32_t | addAlgo (AlgoTypes algoType, AlgorithmEnum &algo) |
Add an algorithm to configuration data. More... | |
int32_t | addAlgoAt (AlgoTypes algoType, AlgorithmEnum &algo, int32_t index) |
Add an algorithm to configuration data at given index. More... | |
int32_t | removeAlgo (AlgoTypes algoType, AlgorithmEnum &algo) |
Remove a algorithm from configuration data. More... | |
int32_t | getNumConfiguredAlgos (AlgoTypes algoType) |
Returns the number of configured algorithms. More... | |
AlgorithmEnum & | getAlgoAt (AlgoTypes algoType, int32_t index) |
Returns the identifier of the algorithm at index. More... | |
bool | containsAlgo (AlgoTypes algoType, AlgorithmEnum &algo) |
Checks if the configuration data of the algorihm type already contains a specific algorithms. More... | |
void | setTrustedMitM (bool yesNo) |
Enables or disables trusted MitM processing. More... | |
bool | isTrustedMitM () |
Check status of trusted MitM processing. More... | |
void | setSasSignature (bool yesNo) |
Enables or disables SAS signature processing. More... | |
bool | isSasSignature () |
Check status of SAS signature processing. More... | |
void | setParanoidMode (bool yesNo) |
Enables or disables paranoid mode. More... | |
bool | isParanoidMode () |
Check status of paranoid mode. More... | |
void | printConfiguredAlgos (AlgoTypes algoTyp) |
Helper function to print some internal data. More... | |
Static Public Attributes | |
static const int | maxNoOfAlgos = 7 |
Set the maximum number of algorithms per algorithm type that an application can configure. More... | |
Private Member Functions | |
AlgorithmEnum & | getAlgoAt (std::vector< AlgorithmEnum * > &a, int32_t index) |
int32_t | addAlgo (std::vector< AlgorithmEnum * > &a, AlgorithmEnum &algo) |
int32_t | addAlgoAt (std::vector< AlgorithmEnum * > &a, AlgorithmEnum &algo, int32_t index) |
int32_t | removeAlgo (std::vector< AlgorithmEnum * > &a, AlgorithmEnum &algo) |
int32_t | getNumConfiguredAlgos (std::vector< AlgorithmEnum * > &a) |
bool | containsAlgo (std::vector< AlgorithmEnum * > &a, AlgorithmEnum &algo) |
std::vector< AlgorithmEnum * > & | getEnum (AlgoTypes algoType) |
void | printConfiguredAlgos (std::vector< AlgorithmEnum * > &a) |
Private Attributes | |
std::vector< AlgorithmEnum * > | hashes |
std::vector< AlgorithmEnum * > | symCiphers |
std::vector< AlgorithmEnum * > | publicKeyAlgos |
std::vector< AlgorithmEnum * > | sasTypes |
std::vector< AlgorithmEnum * > | authLengths |
bool | enableTrustedMitM |
bool | enableSasSignature |
bool | enableParanoidMode |
ZRTP configuration data.
This class contains data and functions to set ZRTP configuration data. An application may use this class to set configuration information for ZRTP. ZRTP uses this configuration information to announce various algorithms via its Hello message. An application may use this class to restrict or allow use of algorithms.
The constructor does not set any algorithms, thus it is an empty configuration. An application may use this empty configuration and hand it over to ZRTP. In this case ZRTP does not announce any algorithms in its Hello message and uses mandatory algorithms only.
An application can configure implemented algorithms only.
Definition at line 312 of file ZrtpConfigure.h.
ZrtpConfigure::ZrtpConfigure | ( | ) |
ZrtpConfigure::~ZrtpConfigure | ( | ) |
int32_t ZrtpConfigure::addAlgo | ( | AlgoTypes | algoType, |
AlgorithmEnum & | algo | ||
) |
Add an algorithm to configuration data.
Adds the specified algorithm to the configuration data. If no free configuration data slot is available the function does not add the algorithm and returns -1. The methods appends the algorithm to the existing algorithms.
algoType | Specifies which algorithm type to select |
algo | The enumeration of the algorithm to add. |
|
private |
int32_t ZrtpConfigure::addAlgoAt | ( | AlgoTypes | algoType, |
AlgorithmEnum & | algo, | ||
int32_t | index | ||
) |
Add an algorithm to configuration data at given index.
Adds the specified algorithm to the configuration data vector at a given index. If the index is larger than the actual size of the configuration vector the method just appends the algorithm.
algoType | Specifies which algorithm type to select |
algo | The enumeration of the algorithm to add. |
index | The index where to add the algorihm |
|
private |
void ZrtpConfigure::clear | ( | ) |
Clear all configuration data.
The functions clears all configuration data.
bool ZrtpConfigure::containsAlgo | ( | AlgoTypes | algoType, |
AlgorithmEnum & | algo | ||
) |
Checks if the configuration data of the algorihm type already contains a specific algorithms.
algoType | Specifies which algorithm type to select |
algo | The algorithm to check |
|
private |
AlgorithmEnum& ZrtpConfigure::getAlgoAt | ( | AlgoTypes | algoType, |
int32_t | index | ||
) |
Returns the identifier of the algorithm at index.
algoType | Specifies which algorithm type to select |
index | The index in the list of the algorihm type |
|
private |
|
private |
int32_t ZrtpConfigure::getNumConfiguredAlgos | ( | AlgoTypes | algoType | ) |
Returns the number of configured algorithms.
algoType | Specifies which algorithm type to select |
|
private |
bool ZrtpConfigure::isParanoidMode | ( | ) |
Check status of paranoid mode.
bool ZrtpConfigure::isSasSignature | ( | ) |
Check status of SAS signature processing.
bool ZrtpConfigure::isTrustedMitM | ( | ) |
Check status of trusted MitM processing.
void ZrtpConfigure::printConfiguredAlgos | ( | AlgoTypes | algoTyp | ) |
Helper function to print some internal data.
|
private |
int32_t ZrtpConfigure::removeAlgo | ( | AlgoTypes | algoType, |
AlgorithmEnum & | algo | ||
) |
Remove a algorithm from configuration data.
Removes the specified algorithm from configuration data. If the algorithm was not configured previously the function does not modify the configuration data and returns the number of free configuration data slots.
If an application removes all algorithms then ZRTP does not include any algorithm into the hello message and falls back to a predefined mandatory algorithm.
algoType | Specifies which algorithm type to select |
algo | The enumeration of the algorithm to remove. |
|
private |
void ZrtpConfigure::setMandatoryOnly | ( | ) |
Convenience function that sets the mandatory algorithms only.
Mandatory algorithms are:
void ZrtpConfigure::setParanoidMode | ( | bool | yesNo | ) |
Enables or disables paranoid mode.
For further explanation of paranoid mode refer to the documentation of ZRtp class.
yesNo | If set to true then paranoid mode is enabled. |
void ZrtpConfigure::setSasSignature | ( | bool | yesNo | ) |
Enables or disables SAS signature processing.
For further details of trusted MitM processing refer to ZRTP specification, chapter 7.2
yesNo | If set to true then certificate processing is enabled. |
void ZrtpConfigure::setStandardConfig | ( | ) |
Convenience function that sets a pre-defined standard configuration.
The standard configuration consists of the following algorithms:
void ZrtpConfigure::setTrustedMitM | ( | bool | yesNo | ) |
Enables or disables trusted MitM processing.
For further details of trusted MitM processing refer to ZRTP specification, chapter 7.3
yesNo | If set to true then trusted MitM processing is enabled. |
|
private |
Definition at line 518 of file ZrtpConfigure.h.
|
private |
Definition at line 522 of file ZrtpConfigure.h.
|
private |
Definition at line 521 of file ZrtpConfigure.h.
|
private |
Definition at line 520 of file ZrtpConfigure.h.
|
private |
Definition at line 514 of file ZrtpConfigure.h.
|
static |
Set the maximum number of algorithms per algorithm type that an application can configure.
Definition at line 321 of file ZrtpConfigure.h.
|
private |
Definition at line 516 of file ZrtpConfigure.h.
|
private |
Definition at line 517 of file ZrtpConfigure.h.
|
private |
Definition at line 515 of file ZrtpConfigure.h.