CogniCrypt icon indicating copy to clipboard operation
CogniCrypt copied to clipboard

Templates for Secure Communication Task require cast operator

Open AndreSonntag opened this issue 5 years ago • 2 comments

Context

The templates for the client-side as well the server-side use factory classes and cast operators like in the following code snippet for the TLSClient:

public TLSClient(String host, int port) throws UnknownHostException, IOException {
SSLSocketFactory sslsocketfactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
SSLSocket sslsocket = (SSLSocket) sslsocketfactory.createSocket(host, port);**	
	
sslsocket.setEnabledCipherSuites(new String[] {"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"});
sslsocket.setEnabledProtocols(new String[] { "TLSv1.2", "TLSv1.1"});
sslsocket.startHandshake();
}

Describe the bug/new feature

Currently, it is not possible to generate a cast construct like in the initialization line of SSLSocketFactory and SSLSocket via the new CrySL code generation. Furthermore, the CrySL syntax does not support cast operators or something similar to depict the described situation.

AndreSonntag avatar Nov 28 '19 09:11 AndreSonntag

@kruegers

AndreSonntag avatar Nov 28 '19 09:11 AndreSonntag

Can you please push the template somewhere? I'd like to be able to debug the feature while developing it. Thanks.

kruegers avatar Nov 28 '19 23:11 kruegers