/* Do the full static ECDH key exchange. When this function is called, it has already been verified that the cipher suite uses ECDH (not ECDHE), and the client's public key (from its certificate) has type EC and is apt for key exchange.  */
static void do_static_ecdh(br_ssl_server_context *ctx, int prf_id)
/* Do the full static ECDH key exchange. When this function is called, it has already been verified that the cipher suite uses ECDH (not ECDHE), and the client's public key (from its certificate) has type EC and is apt for key exchange.  */
static void do_static_ecdh(br_ssl_server_context *ctx, int prf_id)
{
	unsigned char cpoint[133];
	size_t cpoint_len;
	const br_x509_class **xc;
	const br_x509_pkey *pk;
	xc = ctx->eng.x509ctx;
	pk = (*xc)->get_pkey(xc, NULL);
	cpoint_len = pk->key.ec.qlen;
	if (cpoint_len > sizeof cpoint) {
		cpoint_len = 2;
	}
	memcpy(cpoint, pk->key.ec.q, cpoint_len);
	do_ecdh(ctx, prf_id, cpoint, cpoint_len);
}