drbild / sslpsk

Adds TLS-PSK support to the Python ssl package
Apache License 2.0
25 stars 32 forks source link

server hint empty sent #30

Open rpablos opened 8 months ago

rpablos commented 8 months ago

There is an issue with server hint and some clients will not work properly. If you don't specify a server hint, the server hint should not be sent. But in the code what you specify finally is a zero-length bytes object, so you get the hint sent with length equals to zero.

What I did for not changing the c source is:

-In sslpsk.py, in function _ssl_set_psk_server_callback, change _ = _sslpsk.sslpsk_use_psk_identity_hint(_sslobj(sock), hint if hint else b"") for

 if hint:
        _      = _sslpsk.sslpsk_use_psk_identity_hint(_sslobj(sock), hint)

regards