void jpake_server_auth(BIO *out, BIO *conn, const char *secret)
	{
	JPAKE_CTX *ctx;
	BIO *bconn;

	BIO_puts(out, "Authenticating with JPAKE\n");

	ctx = jpake_init("server", "client", secret);

	bconn = BIO_new(BIO_f_buffer());
	BIO_push(bconn, conn);

	jpake_receive_step1(ctx, bconn);
	jpake_send_step1(bconn, ctx);
	jpake_receive_step2(ctx, bconn);
	jpake_send_step2(bconn, ctx);
	jpake_receive_step3a(ctx, bconn);
	jpake_send_step3b(bconn, ctx);

	BIO_puts(out, "JPAKE authentication succeeded, setting PSK\n");

	psk_key = BN_bn2hex(JPAKE_get_shared_key(ctx));

	BIO_pop(bconn);
	BIO_free(bconn);

	JPAKE_CTX_free(ctx);
	}
void jpake_server_auth(BIO *out, BIO *conn, const char *secret)
	{
	JPAKE_CTX *ctx;
	BIO *bconn;

	BIO_puts(out, "Authenticating with JPAKE\n");

	ctx = jpake_init("server", "client", secret);

	bconn = BIO_new(BIO_f_buffer());
	BIO_push(bconn, conn);

	jpake_receive_step1(ctx, bconn);
	jpake_send_step1(bconn, ctx);
	jpake_receive_step2(ctx, bconn);
	jpake_send_step2(bconn, ctx);
	jpake_receive_step3a(ctx, bconn);
	jpake_send_step3b(bconn, ctx);

	BIO_puts(out, "JPAKE authentication succeeded, setting PSK\n");

	psk_key = BN_bn2hex(JPAKE_get_shared_key(ctx));

	BIO_pop(bconn);
	BIO_free(bconn);

	JPAKE_CTX_free(ctx);
	}