[svn-commits] russell: branch group/security_events r200803 - in /team/group/security_event...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jun 15 21:25:21 CDT 2009


Author: russell
Date: Mon Jun 15 21:25:14 2009
New Revision: 200803

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=200803
Log:
Add AMI security events test script, and fix a bug in manager.c found in testing

Added:
    team/group/security_events/tests/test_ami_security_events.sh   (with props)
Modified:
    team/group/security_events/main/manager.c

Modified: team/group/security_events/main/manager.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/security_events/main/manager.c?view=diff&rev=200803&r1=200802&r2=200803
==============================================================================
--- team/group/security_events/main/manager.c (original)
+++ team/group/security_events/main/manager.c Mon Jun 15 21:25:14 2009
@@ -1124,7 +1124,7 @@
 
 static int check_manager_session_inuse(const char *name)
 {
-	struct mansession_session *session = ao2_find(sessions, (char*) name, OBJ_POINTER);
+	struct mansession_session *session = ao2_find(sessions, (char*) name, 0);
 	int inuse = 0;
 
 	if (session) {

Added: team/group/security_events/tests/test_ami_security_events.sh
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/security_events/tests/test_ami_security_events.sh?view=auto&rev=200803
==============================================================================
--- team/group/security_events/tests/test_ami_security_events.sh (added)
+++ team/group/security_events/tests/test_ami_security_events.sh Mon Jun 15 21:25:14 2009
@@ -1,0 +1,47 @@
+#!/bin/bash
+
+# manager.conf:
+#
+# [general]
+# ...
+# allowmultipleconnects=no
+# ...
+#
+# [russell]
+# secret=blah123
+# read = system,call,log,verbose,command,agent,user,config
+# write = system,call,log,verbose,command,agent,user,config
+# deny=0.0.0.0/0.0.0.0
+# permit=127.0.0.1/255.255.255.255
+#
+# [russell2]
+# secret=blah123
+# read = system,call,log,verbose,command,agent,user,config
+# write = system,call,log,verbose,command,agent,user,config
+# deny=127.0.0.1/255.255.255.255
+
+# Invalid User
+printf "Action: Login\r\nUsername: foo\r\nSecret: moo\r\n\r\n" | nc localhost 5038
+
+# Invalid Secret
+printf "Action: Login\r\nUsername: russell\r\nSecret: moo\r\n\r\n" | nc localhost 5038
+
+# Auth Success
+printf "Action: Login\r\nUsername: russell\r\nSecret: blah123\r\n\r\n" | nc -w 1 localhost 5038
+
+# Failed ACL
+printf "Action: Login\r\nUsername: russell2\r\nSecret: blah123\r\n\r\n" | nc -w 1 localhost 5038
+
+# Request Not Allowed
+printf "Action: Login\r\nUsername: russell\r\nSecret: blah123\r\n\r\nAction: Originate\r\n\r\n" | nc -w 1 localhost 5038
+
+# Request Bad Format
+printf "Action: Login\r\nUsername: russell\r\nSecret: blah123\r\n\r\nAction: FakeActionBLAH\r\n\r\n" | nc -w 1 localhost 5038
+
+# Failed Challenge Response
+printf "Action: Challenge\r\nUsername: russell\r\nAuthType: MD5\r\n\r\nAction: Login\r\nUsername: russell\r\nAuthType: MD5\r\nKey: 00000000\r\n\r\n" | nc localhost 5038
+
+# Session Limit
+printf "Action: Login\r\nUsername: russell\r\nSecret: blah123\r\n\r\n" | nc -w 5 localhost 5038 &
+printf "Action: Login\r\nUsername: russell\r\nSecret: blah123\r\n\r\n" | nc -w 1 localhost 5038
+

Propchange: team/group/security_events/tests/test_ami_security_events.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/group/security_events/tests/test_ami_security_events.sh
------------------------------------------------------------------------------
    svn:executable = *

Propchange: team/group/security_events/tests/test_ami_security_events.sh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/group/security_events/tests/test_ami_security_events.sh
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the svn-commits mailing list