How to determine the openssl library version?

I have a prebuilt openssl library (libssl.a and libcrypto.a) that are used for my C ++ application. I do not know the version of the openssl library.

Is there a way to get the version number from these pre-built libraries?

+7
c ++ openssl
source share
5 answers

You can do this programmatically by reading the following:

and

Basically, you will need the following functions:

  • SSLeay()
  • SSLeay_version()
+4
source share

The library has a line containing version information called SSLEAY_VERSION - it looks like this:

  • OpenSSL 0.9.5a 1 Apr 2000
  • OpenSSL 1.0.1e-fips 11 Feb 2013

You can find this from the binary library using strings and grep:

 strings libcrypto.so | grep "^OpenSSL \S\+ [0-9]\+ \S\+ [0-9]\+" 
+9
source share

You can use the following:

 strings libssl.so | grep "^OpenSSL \S\+ [0-9]\+ \S\+ [0-9]\+" 
+3
source share

You can also use:

 openssl version -a 

See the link at: https://linux.die.net/man/1/version

0
source share

Well, filtering may not always work. You could do

 strings libssl.so | grep "^OpenSSL" OpenSSLDie OpenSSL 1.0.2n 7 Dec 2017 strings libcrypto.so | grep "^OpenSSL" OpenSSLDie OpenSSL_add_all_ciphers OpenSSL_add_all_digests OpenSSL 1.0.2n 7 Dec 2017 OpenSSL HMAC method OpenSSL EC algorithm OpenSSL RSA method OpenSSL DSA method OpenSSL ECDSA method OpenSSL DH Method OpenSSL X9.42 DH method OpenSSL PKCS#3 DH method OpenSSL ECDH method OpenSSL 'dlfcn' shared library method OpenSSL default OpenSSL default user interface OpenSSL CMAC method 
0
source share

All Articles