[support #1723748] TLS support for XCAP scenario

Change-Id: I9311b43efc07a4fd2fb1b13805421df25f4f9f78
Signed-off-by: Eduard Czimbalmos <Eduard.Czimbalmos@ericsson.com>
diff --git a/src/Transport/EPTF_CLL_TransportIPL4_Functions.ttcn b/src/Transport/EPTF_CLL_TransportIPL4_Functions.ttcn
index 8642a0c..1e9326d 100644
--- a/src/Transport/EPTF_CLL_TransportIPL4_Functions.ttcn
+++ b/src/Transport/EPTF_CLL_TransportIPL4_Functions.ttcn
@@ -61,6 +61,7 @@
 //      <f_EPTF_Transport_sendTo>

 //      <f_EPTF_Transport_setUserData>

 //      <f_EPTF_Transport_getUserData>

+//      <f_EPTF_Transport_getCurrentCipher>

 //      <f_EPTF_Transport_registerMsgCallback>

 //      <f_EPTF_Transport_getLocalAddress>

 //      <f_EPTF_Transport_getRemoteAddress>

@@ -989,6 +990,41 @@
   pl_result := f_IPL4_getUserData(IPL4_PCO,pl_connId,pl_userData);

 }

 

+///////////////////////////////////////////////////////////

+//  Function: f_EPTF_Transport_getCurrentCipher

+//

+//  Purpose:

+//    Function to get the 4 bytes long ID of the cipher of the established SSL connection

+//

+//  Parameters:

+//    pl_transportType - *in* - <EPTF_Transport_TransportType> - Testport type

+//    pl_connId - *in* - <ConnectionId> - The ID of the connection

+//    pl_currentCipher - *out* - *integer* - the cipher ID, 0 if there is no TLS/SSL used on the connection, or the connection is invalid

+//

+//  Return Value:

+//    -

+//

+//  Errors:

+//    -

+//

+//  Detailed Comments:

+//    See https://www.openssl.org/docs/man1.0.2/man3/SSL_get_current_cipher.html

+//    Last 2 bytes contain the cipher id according to the protection mechanism CipherSuite code

+//    according to the defined values for TLS CipherSuites in the IANA TLS Cipher Suite Registry which is referenced in TLS V1.2

+//

+///////////////////////////////////////////////////////////

+public function f_EPTF_Transport_getCurrentCipher(

+  in EPTF_Transport_TransportType pl_transportType,

+  in ConnectionId pl_connId,

+  out integer pl_currentCipher)

+  runs on EPTF_TransportIPL4_CT

+{

+  if (IPL4 != pl_transportType) {

+    f_EPTF_Base_assert(%definitionId&": The transport type "&log2str(pl_transportType)&

+      " is not supported in the IPL4 transport.", IPL4 == pl_transportType)

+  }

+  pl_currentCipher := f_IPL4_getCurrentCipher(IPL4_PCO, pl_connId);

+}

 

 ///////////////////////////////////////////////////////////

 //  Function: f_EPTF_Transport_registerMsgCallback