References: <20210412164545.11151-1-maximilian.fillinger@...2507...> From: Arne Schwabe Message-ID: <8c219b3e-18e0-db0a-e9ae-25d279a5e8ba@...1227...> Date: Wed, 14 Apr 2021 11:29:41 +0200 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB Subject: Re: [Openvpn-devel] [PATCH v2 1/2] In init_ssl, open the correct CRL path pre-chroot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Antonio Quartulli , Max Fillinger , openvpn-devel@lists.sourceforge.net > >> + if (options->chroot_dir == NULL || in_chroot || options->crl_file_inline) >> + { >> + tls_ctx_reload_crl(new_ctx, options->crl_file, options->crl_file_inline); >> + } >> + else >> + { >> + struct gc_arena gc = gc_new(); >> + struct buffer crl_file_buf = prepend_chroot(options->chroot_dir, options->crl_file, &gc); >> + tls_ctx_reload_crl(new_ctx, BSTR(&crl_file_buf), options->crl_file_inline); >> + gc_free(&gc); >> + } > > Arne: any opinion on using c->c2.gc here? init_ssl() is invoked once per > instance and re-invoked upon SIGUSR1. I believe it is fine to use the > c2's gc? > I would prefer a local gc here. It is easier to see that the memory can be freed right now and we don't add this unecessary depenendency on c2. Also c2 is not clear on renegotiations, so we will collect one string per renegotiation here. Arne