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

Method selectHashAlgorithm

src/jlsrtp.cpp:1843–1922  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1841}
1842
1843int JLSRTP::selectHashAlgorithm(HashType hashType, ActiveCrypto crypto_attrib /*= ACTIVE_CRYPTO*/)
1844{
1845 int retVal = -1;
1846 ActiveCrypto active_crypto = INVALID_CRYPTO;
1847
1848 if (crypto_attrib == ACTIVE_CRYPTO)
1849 {
1850 active_crypto = _active_crypto;
1851 }
1852 else
1853 {
1854 active_crypto = crypto_attrib;
1855 }
1856
1857 switch (active_crypto)
1858 {
1859
1860 case PRIMARY_CRYPTO:
1861 {
1862 switch (hashType)
1863 {
1864 case HMAC_SHA1_80:
1865 {
1866 _primary_crypto.hmac_algorithm = HMAC_SHA1_80;
1867 retVal = 0;
1868 }
1869 break;
1870
1871 case HMAC_SHA1_32:
1872 {
1873 _primary_crypto.hmac_algorithm = HMAC_SHA1_32;
1874 retVal = 0;
1875 }
1876 break;
1877
1878 default:
1879 {
1880 retVal = -1;
1881 }
1882 break;
1883 }
1884 }
1885 break;
1886
1887 case SECONDARY_CRYPTO:
1888 {
1889 switch (hashType)
1890 {
1891 case HMAC_SHA1_80:
1892 {
1893 _secondary_crypto.hmac_algorithm = HMAC_SHA1_80;
1894 retVal = 0;
1895 }
1896 break;
1897
1898 case HMAC_SHA1_32:
1899 {
1900 _secondary_crypto.hmac_algorithm = HMAC_SHA1_32;

Callers 2

createSendingMessageMethod · 0.80
process_incomingMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected