Check that key exchange algorithm is never null
* Check that key exchange algorithm is never null
avoid segfaults on bad cipher suites configuration
@@ -37,6 +37,10 @@ static int s2n_write_signature_blob(struct s2n_stuffer *out, const struct s2n_pk
int s2n_server_key_recv(struct s2n_connection *conn)
{
+ notnull_check(conn);
+ notnull_check(conn->secure.cipher_suite);
+ notnull_check(conn->secure.cipher_suite->key_exchange_alg);
+
struct s2n_hash_state *signature_hash = &conn->secure.signature_hash;
const struct s2n_kex *key_exchange = conn->secure.cipher_suite->key_exchange_alg;
struct s2n_stuffer *in = &conn->handshake.io;
