dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41250?usp=email )
Change subject: ES2Plus_Tests: cleanup/add module parameters
......................................................................
ES2Plus_Tests: cleanup/add module parameters
The ES2Plus_Tests only have minimal configuration options. Let's remove
hardcoded options and replace them with module parameters. Let's also
document the module parameters.
Change-Id: Ib8e128e4af8e819799c4d7ea3e6a36189462f382
Related: SYS#7339
---
M smdpp/ES2Plus_Tests.ttcn
1 file changed, 41 insertions(+), 17 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/50/41250/1
diff --git a/smdpp/ES2Plus_Tests.ttcn b/smdpp/ES2Plus_Tests.ttcn
index c6e84cd..8d35670 100644
--- a/smdpp/ES2Plus_Tests.ttcn
+++ b/smdpp/ES2Plus_Tests.ttcn
@@ -30,22 +30,46 @@
const charstring c_eid1 := "89049032123451234512345678901235";
const charstring c_eid2 := "89049032123451234512345678901236";
-// Client certificate paths
-const charstring c_cert_path := "./test_certs/CERT_MNO_ECDSA_NIST.pem";
-const charstring c_key_path := "./test_certs/SK_MNO_ECDSA_NIST.pem";
-
-// Wrong certificate for testing
+// Wrong certificate for testing (randomly picked from the sgp26 directory)
const charstring c_wrong_cert_path := "./sgp26/eUICC/CERT_EUICC_ECDSA_NIST.der";
const charstring c_wrong_key_path := "./sgp26/eUICC/SK_EUICC_ECDSA_NIST.pem";
+// The external function ext_RSPClient_create requires a path and a name filter as input to load test certificates.
+// While those certfiicates are required for the ES9+ interface related tests (smdpp_Tests.ttcn), for the ES2+
+// interface tests those certificates have no relevance.
+const charstring c_es2plus_cert_path := "./sgp26/";
+const charstring c_es2plus_cert_name_filter := "NIST";
+
// Module parameters
modulepar {
+ //The server host name must match the host name in the SSL certificate of the server. To bind the
+
+ // The SMDP server host name (FQDN) must match the host name of the SSL certificate of the server. To resolve the
+ // server host name to an IP address, an entry in /etc/hosts is sufficient. It should also be pointed out that this
+ // testsuite (libcurl) will also verify the presented server certificate against the related CA. To ensure that
+ // the server certificate verification is possible, ensure that the related CA certificates are made available in
+ // /etc/ssl/certs
charstring mp_es2plus_server_host := "testsmdpplus1.example.com";
- integer mp_es9_server_port := 8000;
- integer mp_es2plus_server_port := 8000; // NIST tests use port 8000
+
+ // Sets the server port of the ES2+ server (SM-DP+).
+ integer mp_es2plus_server_port := 8000;
+
+ // Sets the client certificate to be used to authenticate towards the ES2+ server (SM-DP+)
+ charstring mp_es2plus_client_cert_path := "./test_certs/CERT_MNO_ECDSA_NIST.pem";
+
+ // Sets the private key to be used to authenticate towards the ES2+ server (SM-DP+)
+ charstring mp_es2plus_client_key_path := "./test_certs/SK_MNO_ECDSA_NIST.pem";
+
+ // Sets the operator ID to be used on the ES2+ interface. (this parameter has no relation to SSL/TLS)
charstring mp_operator_id := "test.operator.com";
- charstring mp_nist_rsp_cert_path := "./sgp26/";
+
+ // ES2+ normally uses SSL with client authentication, however for debug purposes it is possible to disable
+ // SSL entirely.
boolean mp_use_ssl := true; // SSL with mutual TLS authentication enabled
+
+ // ES2+ normally uses SSL with client authentication, however for debug purposes it is possible to disable
+ // mutual authentication.
+ boolean mp_use_mutual_tls := true;
}
// Test component - extend smdpp_ConnHdlr to reuse RSPClient functionality
@@ -175,8 +199,8 @@
g_rsp_client_handle := smdpp_Tests.ext_RSPClient_create(
mp_es2plus_server_host,
mp_es2plus_server_port,
- mp_nist_rsp_cert_path,
- "NIST"
+ c_es2plus_cert_path,
+ c_es2plus_cert_name_filter
);
if (g_rsp_client_handle < 0) {
@@ -187,9 +211,9 @@
// Set authentication parameters once for all ES2+ operations
var integer result := smdpp_Tests.ext_RSPClient_setAuthParams(
g_rsp_client_handle,
- true, // useMutualTLS
- c_cert_path,
- c_key_path
+ mp_use_mutual_tls,
+ mp_es2plus_client_cert_path,
+ mp_es2plus_client_key_path
);
if (result != 0) {
@@ -961,7 +985,7 @@
// Temporarily set wrong authentication parameters
var integer result := smdpp_Tests.ext_RSPClient_setAuthParams(
g_rsp_client_handle,
- true, // useMutualTLS
+ mp_use_mutual_tls,
c_wrong_cert_path, // Using wrong certificate
c_wrong_key_path // Using wrong key
);
@@ -994,9 +1018,9 @@
// Restore correct auth params for cleanup
smdpp_Tests.ext_RSPClient_setAuthParams(
g_rsp_client_handle,
- true,
- c_cert_path,
- c_key_path
+ mp_use_mutual_tls,
+ mp_es2plus_client_cert_path,
+ mp_es2plus_client_key_path
);
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41250?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ib8e128e4af8e819799c4d7ea3e6a36189462f382
Gerrit-Change-Number: 41250
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
osmith has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/41247?usp=email )
Change subject: fix SCCP_MAX_OPTIONAL_DATA 128
......................................................................
fix SCCP_MAX_OPTIONAL_DATA 128
Related: SYS#7600
Change-Id: I841dbb2e8cbc13708ba7f5593f6bdd3b8da4329c
(cherry picked from commit 6ea68a2308f8ad008e1e75959d2411999bc8c3eb)
---
M include/osmocom/sccp/sccp_types.h
M src/sccp_vty.c
M tests/vty/osmo_stp_test.vty
M tests/vty/ss7_asp_test.vty
4 files changed, 26 insertions(+), 8 deletions(-)
Approvals:
osmith: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/include/osmocom/sccp/sccp_types.h b/include/osmocom/sccp/sccp_types.h
index 5be0392..ab688b3 100644
--- a/include/osmocom/sccp/sccp_types.h
+++ b/include/osmocom/sccp/sccp_types.h
@@ -24,7 +24,25 @@
#include <osmocom/core/endian.h>
#include <osmocom/core/utils.h>
-#define SCCP_MAX_OPTIONAL_DATA 130
+/* ITU Q.713 3.16 Data is a variable-length IE, meaning it has two header
+ * octets:
+ * - one octet of "Parameter name code",
+ * - plus one octet of length.
+ *
+ * In
+ * - 4.2 CR,
+ * - 4.3 CC,
+ * - 4.4 CREF,
+ * - 4.5 RLSD,
+ * there are optional "Data" IEs with length indicated as "3-130" octets: the
+ * minimum of 3 stems from the two header octets plus one data octet. Note that
+ * when there are zero data octets, the entire "Data" IE is omitted.
+ *
+ * Hence, the maximum of 130 includes the two header octets, and the actual
+ * maximum data length is 128.
+ */
+#define SCCP_MAX_OPTIONAL_DATA 128
+
#define SCCP_MAX_DATA 256
/* Table 1/Q.713 - SCCP message types */
diff --git a/src/sccp_vty.c b/src/sccp_vty.c
index 49f3577..a969423 100644
--- a/src/sccp_vty.c
+++ b/src/sccp_vty.c
@@ -174,10 +174,10 @@
"Adjust the upper bound for the optional data length (the payload) for CR, CC, CREF and RLSD messages."
" For any Optional Data part larger than this value in octets, send CR, CC, CREF and RLSD"
" messages without any payload, and send the data payload in a separate Data Form 1 message."
- " ITU-T Q.713 sections 4.2 thru 4.5 define a limit of 130 bytes for the 'Data' parameter. This limit can be"
+ " ITU-T Q.713 sections 4.2 thru 4.5 define a limit of 128 bytes for the 'Data' parameter. This limit can be"
" adjusted here. May be useful for interop with nonstandard SCCP peers.\n"
"Set a non-standard maximum allowed number of bytes\n"
- "Use the ITU-T Q.713 4.2 to 4.5 standard value of 130\n",
+ "Use the ITU-T Q.713 4.2 to 4.5 standard value of 128\n",
CMD_ATTR_IMMEDIATE)
{
struct osmo_ss7_instance *ss7 = vty->index;
diff --git a/tests/vty/osmo_stp_test.vty b/tests/vty/osmo_stp_test.vty
index cb24560..56b48c5 100644
--- a/tests/vty/osmo_stp_test.vty
+++ b/tests/vty/osmo_stp_test.vty
@@ -528,11 +528,11 @@
<1-999999> Timer value, in seconds
OsmoSTP(config-cs7)# sccp ?
- max-optional-data Adjust the upper bound for the optional data length (the payload) for CR, CC, CREF and RLSD messages. For any Optional Data part larger than this value in octets, send CR, CC, CREF and RLSD messages without any payload, and send the data payload in a separate Data Form 1 message. ITU-T Q.713 sections 4.2 thru 4.5 define a limit of 130 bytes for the 'Data' parameter. This limit can be adjusted here. May be useful for interop with nonstandard SCCP peers.
+ max-optional-data Adjust the upper bound for the optional data length (the payload) for CR, CC, CREF and RLSD messages. For any Optional Data part larger than this value in octets, send CR, CC, CREF and RLSD messages without any payload, and send the data payload in a separate Data Form 1 message. ITU-T Q.713 sections 4.2 thru 4.5 define a limit of 128 bytes for the 'Data' parameter. This limit can be adjusted here. May be useful for interop with nonstandard SCCP peers.
OsmoSTP(config-cs7)# sccp max-optional-data ?
<0-999999> Set a non-standard maximum allowed number of bytes
- standard Use the ITU-T Q.713 4.2 to 4.5 standard value of 130
+ standard Use the ITU-T Q.713 4.2 to 4.5 standard value of 128
OsmoSTP(config-cs7)# show running-config
... !sccp max-optional-data
@@ -563,7 +563,7 @@
OsmoSTP(config-cs7)# show running-config
... !sccp max-optional-data
-OsmoSTP(config-cs7)# sccp max-optional-data 130
+OsmoSTP(config-cs7)# sccp max-optional-data 128
OsmoSTP(config-cs7)# show running-config
... !sccp max-optional-data
diff --git a/tests/vty/ss7_asp_test.vty b/tests/vty/ss7_asp_test.vty
index b565557..f83a452 100644
--- a/tests/vty/ss7_asp_test.vty
+++ b/tests/vty/ss7_asp_test.vty
@@ -513,11 +513,11 @@
<1-999999> Timer value, in seconds
ss7_asp_vty_test(config-cs7)# sccp ?
- max-optional-data Adjust the upper bound for the optional data length (the payload) for CR, CC, CREF and RLSD messages. For any Optional Data part larger than this value in octets, send CR, CC, CREF and RLSD messages without any payload, and send the data payload in a separate Data Form 1 message. ITU-T Q.713 sections 4.2 thru 4.5 define a limit of 130 bytes for the 'Data' parameter. This limit can be adjusted here. May be useful for interop with nonstandard SCCP peers.
+ max-optional-data Adjust the upper bound for the optional data length (the payload) for CR, CC, CREF and RLSD messages. For any Optional Data part larger than this value in octets, send CR, CC, CREF and RLSD messages without any payload, and send the data payload in a separate Data Form 1 message. ITU-T Q.713 sections 4.2 thru 4.5 define a limit of 128 bytes for the 'Data' parameter. This limit can be adjusted here. May be useful for interop with nonstandard SCCP peers.
ss7_asp_vty_test(config-cs7)# sccp max-optional-data ?
<0-999999> Set a non-standard maximum allowed number of bytes
- standard Use the ITU-T Q.713 4.2 to 4.5 standard value of 130
+ standard Use the ITU-T Q.713 4.2 to 4.5 standard value of 128
ss7_asp_vty_test(config-cs7)# show running-config
... !sccp max-optional-data
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/41247?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: osmith/2.1.2
Gerrit-Change-Id: I841dbb2e8cbc13708ba7f5593f6bdd3b8da4329c
Gerrit-Change-Number: 41247
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>