[mod_gnutls-devel] [PATCH] Include GnuTLS version as additional version component in Server string
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Thu Feb 13 22:07:06 CET 2014
On Wed 2014-02-12 16:03:14 -0500, Benny Baumann wrote:
> It would be nice if mod_gnutls could add the used (runtime) version of
> GnuTLS as an additional version component.
>
> The below patch will add this information while falling back to using
> the static version string (plus an indication) if the dynamic version
> could not be constructed.
>
> Regards,
> BenBE.
>
> ---
> src/gnutls_hooks.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/src/gnutls_hooks.c b/src/gnutls_hooks.c
> index 8e9a035..1006b34 100644
> --- a/src/gnutls_hooks.c
> +++ b/src/gnutls_hooks.c
> @@ -452,6 +452,16 @@ int mgs_hook_post_config(apr_pool_t * p, apr_pool_t * plog, apr_pool_t * ptemp,
>
> ap_add_version_component(p, "mod_gnutls/" MOD_GNUTLS_VERSION);
>
> + {
> + char* gnutls_version = apr_psprintf(p, "GnuTLS/%s", gnutls_check_version(NULL));
> + if( !gnutls_version ) {
> + // In case we could not create the above string go for the static version instead
> + ap_add_version_component(p, "GnuTLS/" GNUTLS_VERSION "-static");
> + } else {
> + ap_add_version_component(p, gnutls_version);
> + }
> + }
> +
> return OK;
> }
>
Thanks, this looks good to me.
Applied and pushed.
--dkg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 948 bytes
Desc: not available
URL: </pipermail/attachments/20140213/e562dece/attachment.sig>
More information about the mod_gnutls-devel
mailing list