version: add GSS backend name and version

MIT Kerberos version detection is implemented for autotools and cmake.

Examples:
```
curl 8.17.0-DEV (x86_64-pc-linux-gnu) ... mbedTLS/3.6.4 libidn2/2.3.7 nghttp2/1.59.0 libgss/1.0.4 OpenLDAP/2.6.7
curl 8.17.0-DEV (x86_64-pc-linux-gnu) ... LibreSSL/4.1.1 libidn2/2.3.7 nghttp2/1.59.0 mit-krb5/1.20.1 OpenLDAP/2.6.7
curl 8.17.0-DEV (x86_64-pc-linux-gnu) ... LibreSSL/4.1.1 libidn2/2.3.7 nghttp2/1.59.0 mit-krb5 OpenLDAP/2.6.7
curl 8.17.0-DEV (x86_64-pc-linux-gnu) ... LibreSSL/4.1.1 nghttp2/1.59.0 mit-krb5/1.20.1 OpenLDAP/2.6.7
curl 8.17.0-DEV (aarch64e-apple-darwin24.6.0) ... GnuTLS/3.8.10 libidn2/2.3.8 libssh2/1.11.1 nghttp2/1.67.1 mit-krb5/1.22.1
```

Also:
- cmake/FindGSS: strip project name ("Kerberos 5 release") from
  the version string when detected via `krb5-config`.

Closes #19073
This commit is contained in:
Viktor Szakats 2025-10-15 15:06:08 +02:00
parent 9c36eace60
commit 1a81a8e478
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
5 changed files with 43 additions and 0 deletions

View file

@ -1909,6 +1909,18 @@ if test x"$want_gss" = xyes; then
fi
fi
fi
gss_version=""
if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
gss_version=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --version | $SED 's/Kerberos 5 release //'`
elif test "$PKGCONFIG" != "no"; then
gss_version=`$PKGCONFIG --modversion mit-krb5-gssapi`
elif test -f "$KRB5CONFIG"; then
gss_version=`$KRB5CONFIG --version | $SED 's/Kerberos 5 release //'`
fi
if test -n "$gss_version"; then
AC_MSG_NOTICE([GSS-API MIT Kerberos version detected: $gss_version])
AC_DEFINE_UNQUOTED([CURL_KRB5_VERSION], ["$gss_version"], [MIT Kerberos version])
fi
else
LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
LDFLAGSPC="$LDFLAGSPC $GSSAPI_LIB_DIR"