| 1723 | } |
| 1724 | |
| 1725 | int 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; |
no outgoing calls
no test coverage detected