mirror of
https://github.com/resiprocate/resiprocate.git
synced 2026-01-12 00:05:02 +08:00
- sdpcontainer::Sdp - add get mediaLineAtIndex api
- sdpcontainer::SdpMediaLine - add more crypto type definitions
This commit is contained in:
@@ -262,6 +262,21 @@ Sdp::getMediaLines() const
|
||||
return mMediaLines;
|
||||
}
|
||||
|
||||
SdpMediaLine*
|
||||
Sdp::getMediaLineAtIndex(int indexNumber)
|
||||
{
|
||||
MediaLineList::iterator it = mMediaLines.begin();
|
||||
int mediaLineIndex = 0;
|
||||
for (; it != mMediaLines.end(); it++, mediaLineIndex++)
|
||||
{
|
||||
if (mediaLineIndex == indexNumber)
|
||||
{
|
||||
return *it;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
resip::Data
|
||||
Sdp::getLocalFoundationId(SdpCandidate::SdpCandidateType candidateType,
|
||||
const char * baseAddress,
|
||||
@@ -383,6 +398,7 @@ sdpcontainer::operator<<( EncodeStream& strm, const Sdp& sdp)
|
||||
|
||||
/* ====================================================================
|
||||
|
||||
Copyright (c) 2026, SIP Spectrum, Inc. https://www.sipspectrum.com
|
||||
Copyright (c) 2007-2008, Plantronics, Inc.
|
||||
All rights reserved.
|
||||
|
||||
|
||||
@@ -294,6 +294,7 @@ public:
|
||||
double getMaximumPacketRate() const { return mMaximumPacketRate; }
|
||||
|
||||
const MediaLineList& getMediaLines() const;
|
||||
SdpMediaLine* getMediaLineAtIndex(int indexNumber); // 0 based
|
||||
|
||||
resip::Data getLocalFoundationId(SdpCandidate::SdpCandidateType candidateType, const char * baseAddress, const char * stunAddress=0);
|
||||
|
||||
@@ -369,6 +370,7 @@ EncodeStream& operator<<(EncodeStream& strm, const Sdp& );
|
||||
|
||||
/* ====================================================================
|
||||
|
||||
Copyright (c) 2026, SIP Spectrum, Inc. https://www.sipspectrum.com
|
||||
Copyright (c) 2007-2008, Plantronics, Inc.
|
||||
All rights reserved.
|
||||
|
||||
|
||||
@@ -78,7 +78,11 @@ const char* SdpMediaLine::SdpCryptoSuiteTypeString[] =
|
||||
"NONE",
|
||||
"AES_CM_128_HMAC_SHA1_80",
|
||||
"AES_CM_128_HMAC_SHA1_32",
|
||||
"F8_128_HMAC_SHA1_80"
|
||||
"F8_128_HMAC_SHA1_80",
|
||||
"AES_CM_192_HMAC_SHA1_80",
|
||||
"AES_CM_192_HMAC_SHA1_32",
|
||||
"AES_CM_256_HMAC_SHA1_80",
|
||||
"AES_CM_256_HMAC_SHA1_32"
|
||||
};
|
||||
|
||||
const char* SdpMediaLine::SdpCryptoKeyMethodString[] =
|
||||
@@ -478,6 +482,30 @@ SdpMediaLine::getCryptoSuiteTypeFromString(const char * type)
|
||||
{
|
||||
return CRYPTO_SUITE_TYPE_F8_128_HMAC_SHA1_80;
|
||||
}
|
||||
// RFC6188 places the _CM after the Master Key length for some reason - accept both
|
||||
else if (resip::isEqualNoCase("AES_CM_192_HMAC_SHA1_80", dataType) ||
|
||||
resip::isEqualNoCase("AES_192_CM_HMAC_SHA1_80", dataType))
|
||||
{
|
||||
return CRYPTO_SUITE_TYPE_AES_CM_192_HMAC_SHA1_80;
|
||||
}
|
||||
// RFC6188 places the _CM after the Master Key length for some reason - accept both
|
||||
else if (resip::isEqualNoCase("AES_CM_192_HMAC_SHA1_32", dataType) ||
|
||||
resip::isEqualNoCase("AES_192_CM_HMAC_SHA1_32", dataType))
|
||||
{
|
||||
return CRYPTO_SUITE_TYPE_AES_CM_192_HMAC_SHA1_32;
|
||||
}
|
||||
// RFC6188 places the _CM after the Master Key length for some reason - accept both
|
||||
else if (resip::isEqualNoCase("AES_CM_256_HMAC_SHA1_80", dataType) ||
|
||||
resip::isEqualNoCase("AES_256_CM_HMAC_SHA1_80", dataType))
|
||||
{
|
||||
return CRYPTO_SUITE_TYPE_AES_CM_256_HMAC_SHA1_80;
|
||||
}
|
||||
// RFC6188 places the _CM after the Master Key length for some reason - accept both
|
||||
else if (resip::isEqualNoCase("AES_CM_256_HMAC_SHA1_32", dataType) ||
|
||||
resip::isEqualNoCase("AES_256_CM_HMAC_SHA1_32", dataType))
|
||||
{
|
||||
return CRYPTO_SUITE_TYPE_AES_CM_256_HMAC_SHA1_32;
|
||||
}
|
||||
else
|
||||
{
|
||||
return CRYPTO_SUITE_TYPE_NONE;
|
||||
@@ -830,6 +858,7 @@ sdpcontainer::operator<<( EncodeStream& strm, const SdpMediaLine& sdpMediaLine)
|
||||
|
||||
/* ====================================================================
|
||||
|
||||
Copyright (c) 2026, SIP Spectrum, Inc. https://www.sipspectrum.com
|
||||
Copyright (c) 2007-2008, Plantronics, Inc.
|
||||
All rights reserved.
|
||||
|
||||
|
||||
@@ -130,9 +130,13 @@ public:
|
||||
typedef enum
|
||||
{
|
||||
CRYPTO_SUITE_TYPE_NONE,
|
||||
CRYPTO_SUITE_TYPE_AES_CM_128_HMAC_SHA1_80, // "AES_CM_128_HMAC_SHA1_80" - RFC4568
|
||||
CRYPTO_SUITE_TYPE_AES_CM_128_HMAC_SHA1_32, // "AES_CM_128_HMAC_SHA1_32" - RFC4568
|
||||
CRYPTO_SUITE_TYPE_F8_128_HMAC_SHA1_80 // "F8_128_HMAC_SHA1_80" - RFC4568
|
||||
CRYPTO_SUITE_TYPE_AES_CM_128_HMAC_SHA1_80, // RFC4568
|
||||
CRYPTO_SUITE_TYPE_AES_CM_128_HMAC_SHA1_32, // RFC4568
|
||||
CRYPTO_SUITE_TYPE_F8_128_HMAC_SHA1_80, // RFC4568
|
||||
CRYPTO_SUITE_TYPE_AES_CM_192_HMAC_SHA1_80, // RFC6188
|
||||
CRYPTO_SUITE_TYPE_AES_CM_192_HMAC_SHA1_32, // RFC6188
|
||||
CRYPTO_SUITE_TYPE_AES_CM_256_HMAC_SHA1_80, // RFC6188
|
||||
CRYPTO_SUITE_TYPE_AES_CM_256_HMAC_SHA1_32 // RFC6188
|
||||
} SdpCryptoSuiteType;
|
||||
static const char* SdpCryptoSuiteTypeString[];
|
||||
|
||||
@@ -682,6 +686,7 @@ EncodeStream& operator<<(EncodeStream& strm, const SdpMediaLine& );
|
||||
|
||||
/* ====================================================================
|
||||
|
||||
Copyright (c) 2026, SIP Spectrum, Inc. https://www.sipspectrum.com
|
||||
Copyright (c) 2007-2008, Plantronics, Inc.
|
||||
All rights reserved.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user