tls-attacker / TLS-Attacker

TLS-Attacker is a Java-based framework for analyzing TLS libraries. It can be used to manually test TLS clients and servers or as as a software library for more advanced tools.
Apache License 2.0
804 stars 140 forks source link

"Could not compute correct GOST key blob: using byte[0]" when connecting to openssl with gost-engine #94

Open TQ86 opened 3 years ago

TQ86 commented 3 years ago

Hello, I've just tried to connect to openssl with gost-engine from TLS-Client.jar.

java -jar TLS-Client.jar -connect localhost:
4433 -cipher TLS_GOSTR341112_256_WITH_28147_CNT_IMIT -version TLS12

Openssl works in a docker from this image: https://github.com/rnixik/docker-openssl-gost

openssl req -x509 -newkey gost2012_256 -pkeyopt paramset:A -nodes -keyout key.pem -out cert.pem
openssl s_server -key key.pem -cert cert.pem

debug.log

ic0ns commented 3 years ago

Hm, our GOST support is not so good. I had a student implement it for fun, but as we ourselves literally nether use it I don't know if the code is actually functional anymore. But even back then, we noticed that the different GOST implementations like in Openssl and Libressl are not always compatible with each other. Since there might be a regression maybe an older version will still work. Does the openssl debug output give any hints why it throws a decode alert?

TQ86 commented 3 years ago

An error occurs not only with openssl but with tls-server too. Public key built at GOSTClientKeyExchange.prepareEphemeralKey() couldn't be converted to java.security.PublicKey at prepareKeyBlob() using GOSTUtils.convertPointToPublicKey()