CogniCrypt
CogniCrypt copied to clipboard
Templates for Secure Communication Task require cast operator
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.
@kruegers
Can you please push the template somewhere? I'd like to be able to debug the feature while developing it. Thanks.