MINOR: cfgcond: implements openssl_version_atleast and openssl_version_before

Implements a way of checking the running openssl version:

If the OpenSSL support was not compiled within HAProxy it will returns a
error, so it's recommanded to do a SSL feature check before:

	$ ./haproxy -cc 'feature(OPENSSL) && openssl_version_atleast(0.9.8zh) && openssl_version_before(3.0.0)'

This will allow to select the SSL reg-tests more carefully.
This commit is contained in:
William Lallemand
2021-08-21 23:59:56 +02:00
parent 44d862d8d4
commit 3aeb3f9347
4 changed files with 65 additions and 6 deletions

View File

@@ -50,6 +50,8 @@ enum cond_predicate {
CFG_PRED_STRNEQ, // "strneq"
CFG_PRED_VERSION_ATLEAST, // "version_atleast"
CFG_PRED_VERSION_BEFORE, // "version_before"
CFG_PRED_OSSL_VERSION_ATLEAST, // "openssl_version_atleast"
CFG_PRED_OSSL_VERSION_BEFORE, // "openssl_version_before"
};
/* types for condition terms */

View File

@@ -1093,4 +1093,8 @@ static inline void update_char_fingerprint(uint8_t *fp, char prev, char curr)
fp[32 * from + to]++;
}
/* compare the current OpenSSL version to a string */
int openssl_compare_current_version(const char *version);
#endif /* _HAPROXY_TOOLS_H */