diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 21ca94ddef99a2c0696ab7892ddec8ff09ec653e..a3b972ffe78fdbcd0d37914329f35ecfa6f8d0c5 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -5284,7 +5284,7 @@ module OneM2M_Functions { log(">>> f_getLocalPoA: ", p_portDesc); if (ischosen(p_portDesc.binding.httpBindingDesc)) { - if (ispresent(p_portDesc.binding.httpBindingDesc.bindingDesc.useTls) and (p_portDesc.binding.httpBindingDesc.bindingDesc.useTls == true)) { + if (ispresent(p_portDesc.security)) { v_poa := "https://" & p_portDesc.binding.httpBindingDesc.bindingDesc.tsAddress; } else { v_poa := "http://" & p_portDesc.binding.httpBindingDesc.bindingDesc.tsAddress; @@ -5293,7 +5293,11 @@ module OneM2M_Functions { v_poa := v_poa & ":" & int2str(p_portDesc.binding.httpBindingDesc.bindingDesc.localPort); } } else if (ischosen(p_portDesc.binding.coapBindingDesc)) { - v_poa := "coap://" & p_portDesc.binding.coapBindingDesc.bindingDesc.tsAddress; + if (ispresent(p_portDesc.security)) { + v_poa := "coaps://" & p_portDesc.binding.coapBindingDesc.bindingDesc.tsAddress; + } else { + v_poa := "coap://" & p_portDesc.binding.coapBindingDesc.bindingDesc.tsAddress; + } if (ispresent(p_portDesc.binding.coapBindingDesc.bindingDesc.localPort)) { v_poa := v_poa & ":" & int2str(p_portDesc.binding.coapBindingDesc.bindingDesc.localPort); } @@ -5908,7 +5912,7 @@ module OneM2M_Functions { p_targetIutAddress := p_sendingPort.binding.wsBindingDesc.bindingDesc.sutAddress & ":" & int2str(p_sendingPort.binding.wsBindingDesc.bindingDesc.remotePort); } - if (ischosen(p_receivingPort.binding.httpBindingDesc)) { + if (ischosen(p_receivingPort.binding.httpBindingDesc)) { p_protocolBindingIn := "HTTP"; } else if (ischosen(p_receivingPort.binding.coapBindingDesc)) { p_protocolBindingIn := "COAP"; @@ -6942,7 +6946,7 @@ module OneM2M_Functions { in InterfaceIds p_interfaceIds, in template MsgOut p_msgOut ) runs on Tester { - log(">>> f_send: ", p_interfaceIds); + log(">>> f_send: ", p_interfaceIds, " - ", p_msgOut); p_msgOut.host := vc_myInterfaces[enum2int(p_interfaceIds)].myHost; p_msgOut.protocolBinding := vc_myInterfaces[enum2int(p_interfaceIds)].myProtocolBinding; diff --git a/LibOneM2M/OneM2M_Pixits.ttcn b/LibOneM2M/OneM2M_Pixits.ttcn index ac4c5be6e8255583e5fe2f0fbd8ef2bf2c93a255..50bed0e9d56d77e84770aa4856a5c1f767689fce 100644 --- a/LibOneM2M/OneM2M_Pixits.ttcn +++ b/LibOneM2M/OneM2M_Pixits.ttcn @@ -173,11 +173,11 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort := 8080, // SUT CoAP/HTTP port localPort := 3031, // Test Adapter client port (for debug purpose only) - sutAddress := "127.0.0.1", - useTls := omit + sutAddress := "127.0.0.1" } } }, + security := omit, serialization := "xml" }, mcaPortIn := { @@ -188,11 +188,11 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort := omit, localPort := 3041, // Test Adapter listener port (AeSimu acts as server) - sutAddress := "127.0.0.1", - useTls := omit + sutAddress := "127.0.0.1" } } }, + security := omit, serialization := "xml" } }; @@ -207,11 +207,11 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort := 8080, // SUT CoAP/HTTP port localPort := 3032, // Test Adapter client port (for debug purpose only) - sutAddress := "127.0.0.1", - useTls := omit + sutAddress := "127.0.0.1" } } }, + security := omit, serialization := "xml" }, mcaPortIn := { @@ -222,11 +222,11 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort := omit, localPort := 3042, // Test Adapter listener port (AeSimu acts as server) - sutAddress := "127.0.0.1", - useTls := omit + sutAddress := "127.0.0.1" } } }, + security := omit, serialization := "xml" } }; @@ -244,11 +244,11 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort:= 8080, localPort := 3131, - sutAddress := "127.0.0.1", - useTls := omit + sutAddress := "127.0.0.1" } } }, + security := omit, serialization := "xml" }, mcaPortIn := { @@ -259,11 +259,11 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort:= omit, localPort := 3141, - sutAddress := "127.0.0.1", - useTls := omit + sutAddress := "127.0.0.1" } } }, + security := omit, serialization := "xml" }, mccPort := { @@ -274,11 +274,11 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort:= 8080, localPort := 4131, - sutAddress := "127.0.0.1", - useTls := omit + sutAddress := "127.0.0.1" } } }, + security := omit, serialization := "xml" }, mccPortIn := { @@ -289,11 +289,11 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort:= omit, localPort := 4141, - sutAddress := "127.0.0.1", - useTls := omit + sutAddress := "127.0.0.1" } } }, + security := omit, serialization := "xml" } }; @@ -311,11 +311,11 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort:= 8080, localPort := 3132, - sutAddress := "127.0.0.1", - useTls := omit + sutAddress := "127.0.0.1" } } }, + security := omit, serialization := "json" }, mcaPortIn := { @@ -326,11 +326,11 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort:= 8080, localPort := 3142, - sutAddress := "127.0.0.1", - useTls := omit + sutAddress := "127.0.0.1" } } }, + security := omit, serialization := "json" }, mccPort := { @@ -341,11 +341,11 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort:= 8080, localPort := 4132, - sutAddress := "127.0.0.1", - useTls := omit + sutAddress := "127.0.0.1" } } }, + security := omit, serialization := "json" }, mccPortIn := { @@ -356,11 +356,12 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort:= 8080, localPort := 4142, - sutAddress := "127.0.0.1", - useTls := omit + sutAddress := "127.0.0.1" + } } }, + security := omit, serialization := "json" } }; @@ -377,11 +378,11 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort := 8080, // SUT CoAP/HTTP port localPort := 3033, // Test Adapter client port (for debug purpose only) - sutAddress := "127.0.0.1", - useTls := omit + sutAddress := "127.0.0.1" } } }, + security := omit, serialization := "xml" }, mcaPortIn := { @@ -392,11 +393,11 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort := omit, localPort := 3043, // Test Adapter listener port (AeSimu acts as server) - sutAddress := "127.0.0.1", - useTls := omit + sutAddress := "127.0.0.1" } } }, + security := omit, serialization := "xml" } }; diff --git a/LibOneM2M/OneM2M_TypesAndValues.ttcn b/LibOneM2M/OneM2M_TypesAndValues.ttcn index 32d16bac987aa946df43823b8a02e7edb545c8cf..d79fa768e0fa209c30ac4a87d7a6f5370e172b2b 100644 --- a/LibOneM2M/OneM2M_TypesAndValues.ttcn +++ b/LibOneM2M/OneM2M_TypesAndValues.ttcn @@ -4325,15 +4325,12 @@ group OtherTypes { * The local client port. In this case, the value 'omit' is interpreted as random port number by the Test Adapter * @member sutAddress SUT IP address, optional. * If omitted, the SUT IP address defined in SutDesc data structure will be used by the Test Adapter - * @member useTls Set to true if HTTPS shall be used, optional. - * If omitted, regular HTTP is used */ type record BindingDesc { charstring tsAddress, integer remotePort optional, integer localPort optional, - charstring sutAddress, - boolean useTls optional + charstring sutAddress } /** @@ -4362,8 +4359,8 @@ group OtherTypes { type record MqttBindingDesc { ProtocolBindings bindingProtocol (e_mqtt), BindingDesc bindingDesc, - XSD.ID originator, - XSD.ID receiver + XSD.ID originator, + XSD.ID receiver } /** @@ -4389,8 +4386,32 @@ group OtherTypes { */ type record PortDesc { BindingProtocolsSelect binding, + TransportSecurity security optional, SerializationRepresentations serialization } + + /** + * @desc Transport Layer security description + * Apply for both TSL and DTLS + * @member rootCert Test System root ca or internmediate root CA + * @member trustedCerts IUT cerver certificate, including IUT root ca or internmediate root CA + * @member serverSign Signature Test System certificate for the server side + * @member serverEnc Encryption Test System certificate for the server side + * @member clientSign Signature Test System certificate for the client side + * @member clientEnc Encryption Test System certificate for the client side + * @member psk_identity TLS-PSK identity + * @member psk_key TLS-PSK shared secret + */ + type record TransportSecurity { + charstring rootCert, + charstring trustedCerts, + charstring serverSign, + charstring serverEnc, + charstring clientSign, + charstring clientEnc, + octetstring psk_identity optional, + octetstring psk_key optional + } /** * @desc UpperTester component settings