static int dh_set_peer(void *vpdhctx, void *vdh)
{
    PROV_DH_CTX *pdhctx = (PROV_DH_CTX *)vpdhctx;

    DH_free(pdhctx->dhpeer);
    pdhctx->dhpeer = vdh;
    DH_up_ref(pdhctx->dhpeer);

    return pdhctx->dhpeer != NULL;
}