Could someone with SSL module core knowledge take a look at SSL.handshake.server_derive_master_secret? In the KE_dh_anon case in the main switch premaster_secret is set to dh_state->get_shared(). Since premaster_secret is a string and get_shared returns a Gmp.mpz object, this is wrong. What should it be?