mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
Added new test for a different regex supporting the Cisco style that omits
some parameters prescribed in RFC4568.
This commit is contained in:
@ -122,6 +122,26 @@ void SdesNegotiatorTest::testKeyParamsPattern()
|
||||
pattern = NULL;
|
||||
}
|
||||
|
||||
void SdesNegotiatorTest::testKeyParamsPatternCiscoStyle()
|
||||
{
|
||||
|
||||
std::string subject = "inline:d0RmdmcmVCspeEc3QGZiNWpVLFJhQX1cfHAwJSoj";
|
||||
|
||||
pattern = new sfl::Pattern("(?P<srtpKeyMethod>inline|[A-Za-z0-9_]+)\\:" \
|
||||
"(?P<srtpKeyInfo>[A-Za-z0-9\x2B\x2F\x3D]+)" \
|
||||
"(\\|2\\^(?P<lifetime>[0-9]+)\\|" \
|
||||
"(?P<mkiValue>[0-9]+)\\:" \
|
||||
"(?P<mkiLength>[0-9]{1,3})\\;?)?", "g");
|
||||
|
||||
*pattern << subject;
|
||||
pattern->matches();
|
||||
CPPUNIT_ASSERT(pattern->group("srtpKeyMethod").compare("inline:"));
|
||||
CPPUNIT_ASSERT(pattern->group("srtpKeyInfo").compare("d0RmdmcmVCspeEc3QGZiNWpVLFJhQX1cfHAwJSoj") == 0);
|
||||
|
||||
delete pattern;
|
||||
pattern = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make sure that all the fields can be extracted
|
||||
* properly from the syntax.
|
||||
|
@ -65,6 +65,7 @@ class SdesNegotiatorTest : public CppUnit::TestCase {
|
||||
CPPUNIT_TEST( testTagPattern );
|
||||
CPPUNIT_TEST( testCryptoSuitePattern );
|
||||
CPPUNIT_TEST( testKeyParamsPattern );
|
||||
CPPUNIT_TEST( testKeyParamsPatternCiscoStyle );
|
||||
CPPUNIT_TEST( testNegotiation );
|
||||
// CPPUNIT_TEST( testComponent );
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
@ -91,6 +92,8 @@ class SdesNegotiatorTest : public CppUnit::TestCase {
|
||||
|
||||
void testKeyParamsPattern();
|
||||
|
||||
void testKeyParamsPatternCiscoStyle();
|
||||
|
||||
void testNegotiation();
|
||||
|
||||
void testComponent();
|
||||
|
Reference in New Issue
Block a user