MCPcopy Create free account
hub / github.com/SIPp/sipp / selectCipherAlgorithm

Method selectCipherAlgorithm

src/jlsrtp.cpp:1725–1803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1723}
1724
1725int JLSRTP::selectCipherAlgorithm(CipherType cipherType, ActiveCrypto crypto_attrib /*= ACTIVE_CRYPTO*/)
1726{
1727 int retVal = -1;
1728 ActiveCrypto active_crypto = INVALID_CRYPTO;
1729
1730 if (crypto_attrib == ACTIVE_CRYPTO)
1731 {
1732 active_crypto = _active_crypto;
1733 }
1734 else
1735 {
1736 active_crypto = crypto_attrib;
1737 }
1738
1739 switch (active_crypto)
1740 {
1741 case PRIMARY_CRYPTO:
1742 {
1743 switch (cipherType)
1744 {
1745 case AES_CM_128:
1746 {
1747 _primary_crypto.cipher_algorithm = AES_CM_128;
1748 retVal = 0;
1749 }
1750 break;
1751
1752 case NULL_CIPHER:
1753 {
1754 _primary_crypto.cipher_algorithm = NULL_CIPHER;
1755 retVal = 0;
1756 }
1757 break;
1758
1759 default:
1760 {
1761 retVal = -1;
1762 }
1763 break;
1764 }
1765 }
1766 break;
1767
1768 case SECONDARY_CRYPTO:
1769 {
1770 switch (cipherType)
1771 {
1772 case AES_CM_128:
1773 {
1774 _secondary_crypto.cipher_algorithm = AES_CM_128;
1775 retVal = 0;
1776 }
1777 break;
1778
1779 case NULL_CIPHER:
1780 {
1781 _secondary_crypto.cipher_algorithm = NULL_CIPHER;
1782 retVal = 0;

Callers 2

createSendingMessageMethod · 0.80
process_incomingMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected