Skip to content

Commit 861f670

Browse files
InterLinked1Friendly Automation
authored andcommitted
chan_iax2: Add tests for encryption with RSA authentication
Previously, RSA authentication in IAX2 did not allow encryption to be used. This test ensures that MD5 and RSA authentication modes function properly when encryption is used. Change-Id: I6e4595b7b6166a83fae30beafeef237e2ecf1910
1 parent bb30db8 commit 861f670

File tree

16 files changed

+484
-0
lines changed

16 files changed

+484
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[general]
2+
3+
[globals]
4+
5+
[iaxtest]
6+
7+
exten => 1000,1,Answer()
8+
exten => 1000,n,Echo()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[general]
2+
3+
bindport=4570
4+
bindaddr=127.0.0.1
5+
6+
disallow=all
7+
allow=ulaw
8+
9+
jitterbuffer=no
10+
forcejitterbuffer=no
11+
12+
encryption=yes
13+
14+
[guest70]
15+
type=user
16+
context=iaxtest
17+
auth=md5
18+
secret=passw0rd
19+
forceencryption=yes
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[general]
2+
unanswered=yes
3+
[csv]
4+
usegmtime=yes ; log date/time in GMT. Default is "no"
5+
loguniqueid=yes ; log uniqueid. Default is "no"
6+
loguserfield=yes ; log user field. Default is "no"
7+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[general]
2+
3+
[globals]
4+
5+
[iaxtest]
6+
7+
exten => 1000,1,Answer()
8+
exten => 1000,n,Wait(1)
9+
exten => 1000,n,Hangup()
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[general]
2+
3+
bindport=4569
4+
bindaddr=127.0.0.1
5+
6+
disallow=all
7+
allow=ulaw
8+
9+
encryption=yes
10+
11+
[guest69]
12+
type=user
13+
context=iaxtest
14+
auth=md5
15+
secret=passw0rd
16+
forceencryption=yes
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
testinfo:
2+
summary: 'Test a basic IAX2 call using MD5 authentication with encryption'
3+
description: |
4+
'This test initiates an IAX2 call between 2 instances of Asterisk.
5+
The test only verifies that an IAX2 call is actually instantiated
6+
between the two Asterisk instances using MD5 authentication and
7+
encryption and that proper records are generated.'
8+
9+
properties:
10+
dependencies:
11+
- python : 'twisted'
12+
- python : 'starpy'
13+
- asterisk : 'cdr_csv'
14+
tags:
15+
- iax2
16+
17+
test-modules:
18+
test-object:
19+
config-section: test-object-config
20+
typename: 'test_case.TestCaseModule'
21+
modules:
22+
-
23+
config-section: originator
24+
typename: 'pluggable_modules.Originator'
25+
-
26+
config-section: ami-config
27+
typename: 'ami.AMIEventModule'
28+
-
29+
config-section: hangup-monitor
30+
typename: 'pluggable_modules.HangupMonitor'
31+
-
32+
config-section: cdr-config
33+
typename: 'cdr.CDRModule'
34+
-
35+
config-section: 'cel-config'
36+
typename: 'ami.AMIEventModule'
37+
38+
39+
test-object-config:
40+
asterisk-instances: 2
41+
connect-ami: True
42+
43+
originator:
44+
trigger: 'ami_connect'
45+
id: '0'
46+
channel: 'IAX2/guest69:passw0rd@127.0.0.1:4569/1000'
47+
context: 'iaxtest'
48+
exten: '1000'
49+
priority: '1'
50+
async: 'True'
51+
52+
ami-config:
53+
-
54+
id: '0'
55+
type: 'headermatch'
56+
count: '1'
57+
conditions:
58+
match:
59+
Event: 'Newchannel'
60+
requirements:
61+
match:
62+
Channel: 'IAX2/.*'
63+
-
64+
id: '1'
65+
type: 'headermatch'
66+
count: '1'
67+
conditions:
68+
match:
69+
Event: 'Newchannel'
70+
requirements:
71+
match:
72+
Channel: 'IAX2/.*'
73+
-
74+
id: '0'
75+
type: 'headermatch'
76+
count: '1'
77+
conditions:
78+
match:
79+
Event: 'Hangup'
80+
requirements:
81+
match:
82+
Channel: 'IAX2/.*'
83+
-
84+
id: '1'
85+
type: 'headermatch'
86+
count: '1'
87+
conditions:
88+
match:
89+
Event: 'Hangup'
90+
requirements:
91+
match:
92+
Channel: 'IAX2/.*'
93+
94+
hangup-monitor:
95+
ids: '0'
96+
97+
cdr-config:
98+
-
99+
id: 0
100+
file: 'Master'
101+
lines:
102+
-
103+
destination: '1000'
104+
dcontext: 'iaxtest'
105+
channel: 'IAX2/.*'
106+
lastapp: 'Echo'
107+
disposition: 'ANSWERED'
108+
amaflags: 'DOCUMENTATION'
109+
-
110+
id: 1
111+
file: 'Master'
112+
lines:
113+
-
114+
destination: '1000'
115+
dcontext: 'iaxtest'
116+
channel: 'IAX2/.*'
117+
lastapp: 'Hangup'
118+
disposition: 'ANSWERED'
119+
amaflags: 'DOCUMENTATION'
120+
121+
cel-config:
122+
-
123+
id: '0'
124+
type: 'cel'
125+
conditions:
126+
match:
127+
Channel: 'IAX2/.*'
128+
requirements:
129+
-
130+
match:
131+
EventName: CHAN_START
132+
-
133+
match:
134+
EventName: ANSWER
135+
-
136+
match:
137+
EventName: HANGUP
138+
-
139+
match:
140+
EventName: CHAN_END
141+
-
142+
match:
143+
EventName: LINKEDID_END
144+
-
145+
id: '1'
146+
type: 'cel'
147+
conditions:
148+
match:
149+
Channel: 'IAX2/.*'
150+
requirements:
151+
-
152+
match:
153+
EventName: CHAN_START
154+
-
155+
match:
156+
EventName: ANSWER
157+
-
158+
match:
159+
EventName: HANGUP
160+
-
161+
match:
162+
EventName: CHAN_END
163+
-
164+
match:
165+
EventName: LINKEDID_END
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[general]
2+
3+
[globals]
4+
5+
[iaxtest]
6+
7+
exten => 1000,1,Answer()
8+
exten => 1000,n,Echo()
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[general]
2+
3+
bindport=4570
4+
bindaddr=127.0.0.1
5+
6+
disallow=all
7+
allow=ulaw
8+
9+
jitterbuffer=no
10+
forcejitterbuffer=no
11+
12+
encryption=yes
13+
14+
[guest70]
15+
type=user
16+
context=iaxtest
17+
auth=md5
18+
secret=passw0rd
19+
forceencryption=yes
20+
21+
[toguest69]
22+
type=peer
23+
username=guest69
24+
host=127.0.0.1
25+
port=4569
26+
secret=passw0rd
27+
auth=rsa
28+
outkey=test
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[general]
2+
unanswered=yes
3+
[csv]
4+
usegmtime=yes ; log date/time in GMT. Default is "no"
5+
loguniqueid=yes ; log uniqueid. Default is "no"
6+
loguserfield=yes ; log user field. Default is "no"
7+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[general]
2+
3+
[globals]
4+
5+
[iaxtest]
6+
7+
exten => 1000,1,Answer()
8+
exten => 1000,n,Wait(1)
9+
exten => 1000,n,Hangup()

0 commit comments

Comments
 (0)