MINOR: ssl: add an openssl version string parser

openssl_version_parser() parse a string in the OpenSSL version format
which is documented here:

https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_VERSION_NUMBER.html

The function returns an unsigned int that could be used for comparing
openssl versions.
This commit is contained in:
William Lallemand
2021-08-21 23:16:06 +02:00
parent fff1e583aa
commit 44d862d8d4
2 changed files with 85 additions and 1 deletions

View File

@@ -38,8 +38,8 @@ int ssl_sock_get_dn_entry(X509_NAME *a, const struct buffer *entry, int pos,
struct buffer *out);
int ssl_sock_get_dn_formatted(X509_NAME *a, const struct buffer *format, struct buffer *out);
int ssl_sock_get_dn_oneline(X509_NAME *a, struct buffer *out);
X509* ssl_sock_get_peer_certificate(SSL *ssl);
unsigned int openssl_version_parser(const char *version);
#endif /* _HAPROXY_SSL_UTILS_H */
#endif /* USE_OPENSSL */