Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Library:OpenSSL

From ReverseEngineering.wiki
Library
Vendor OpenSSL Project
Platforms Windows, Linux, macOS, many others
License Apache-2.0 (3.0+), OpenSSL/SSLeay (older)
Website https://www.openssl.org
On this wiki Facts · Code · Notes · Topics

The most widely embedded TLS and cryptography library (C, Apache-2.0 since 3.0; OpenSSL/SSLeay license before): libcrypto and libssl, shipped as shared libraries or linked statically into countless Windows and Linux programs. Its version is recoverable from one plain-text string, and its forks (LibreSSL, BoringSSL, AWS-LC, quictls) answer to the same API names.

Identification

  • Version string: OpenSSL_version(OPENSSL_VERSION) returns the constant OPENSSL_VERSION_TEXT, which in 3.x and later is "OpenSSL " + full version + " " + release date, e.g. OpenSSL 3.x.y 11 Feb 2025 (day, abbreviated month, year). It sits in .rdata of libcrypto or of the statically linked binary; a plain string search for OpenSSL 3., OpenSSL 1.1.1 or OpenSSL 1.0.2 finds it. 1.x releases carry a letter suffix (1.1.1w, 1.0.2u).
  • Further build strings returned by OpenSSL_version(): built on: ..., platform: ..., compiler: ... (the CFLAGS, often with build-machine paths unless stripped), OPENSSLDIR: "...", MODULESDIR: "...", ENGINESDIR: ... and CPUINFO: .... The OPENSSLDIR default path (e.g. /usr/local/ssl, or a Windows Program Files\Common Files\SSL path) names the config file location and is a build-origin clue.
  • OPENSSL_VERSION_NUMBER: 3.0 and later synthesize it as (major<<28)|(minor<<20)|(patch<<4) (layout 0xMNN00PP0L), so 3.0.13 is 0x300000D0. 1.x used 0xMNNFFPPSL (1.1.1w is 0x1010117f; from general documentation). Programs compare OpenSSL_version_num() against this at run time.
  • Shared library names (from general documentation, not from the cited commit): Linux libssl.so.3 / libcrypto.so.3 (soname = SHLIB_VERSION; .so.1.1 for 1.1.x, .so.1.0.0 for 1.0.x); Windows libssl-3-x64.dll / libcrypto-3-x64.dll (-3.dll for x86, -3-arm64.dll), libssl-1_1-x64.dll for 1.1.x, and ssleay32.dll / libeay32.dll for 0.9.x to 1.0.x.
  • Error strings: ERR_error_string uses a library-name table: bignum routines, rsa routines, Diffie-Hellman routines, digital envelope routines, memory buffer routines, object identifier routines, PEM routines, dsa routines, x509 certificate routines, asn1 encoding routines, SSL routines, system library ... A cluster of these in .rdata is a strong OpenSSL marker even without a version string. Messages print as error:<8 hex digits>:<library>:<function>:<reason>; since 3.0 the function field is empty (error:0A000086:SSL routines::certificate verify failed).
  • Providers (3.x): the strings OpenSSL Default Provider, OpenSSL Base Provider, OpenSSL Legacy Provider and OpenSSL Null Provider (returned as the provider name parameter) identify the 3.x provider architecture; their absence together with ENGINE_* imports suggests 1.x.
  • Source paths: debug-capable builds keep crypto/... and ssl/... file names (for example ssl/statem/statem_lib.c) as arguments of the error-raising calls, so such paths in .rdata give the version-specific file layout.

Forks that look the same

  • LibreSSL: reports LibreSSL 3.x.y from OpenSSL_version(OPENSSL_VERSION); defines LIBRESSL_VERSION_NUMBER.
  • BoringSSL / AWS-LC: BoringSSL has no release versions, so consumers show just BoringSSL; AWS-LC identifies as AWS-LC. See Library:Libcurl for how a consumer prints the package name before the slash.
  • quictls reports itself as OpenSSL; it differs by its QUIC API.

See Technique:Identifying cryptographic libraries for a comparison table, and Library:LibreSSL, Library:BoringSSL for fork-specific version macros (LibreSSL pins OPENSSL_VERSION_NUMBER to 0x20000000, BoringSSL to 0x1010107f).

Cryptographic constants

Table-driven code gives anchors independent of version strings: MD5/SHA-1 initial state 0x67452301 (INIT_DATA_h0 in crypto/sha/sha_local.h), 0xEFCDAB89, 0x98BADCFE, 0x10325476, and 0xC3D2E1F0 for SHA-1; SHA-256 round constants starting 0x428A2F98; the AES S-box and T-tables. General table of constants for other algorithms: Technique:Identifying cryptographic constants.

Code & repositories

  • https://github.com/openssl/openssl @ 6d76833d61fad07a171219d9cb1444bc37f88b8f · license: Apache-2.0 (declared by the contributor for the files used; GitHub reports Apache-2.0 (read from LICENSE.txt; GitHub's API was busy) for the repository)
    OpenSSL upstream source (Apache-2.0): reference for version strings, structures and error-code tables.
    Tested on: source read, not run: source reading · checked 2026-10-18

Evidence & references

Read from the OpenSSL source at commit 6d76833d61fad07a171219d9cb1444bc37f88b8f (master, 4.2-dev): include/openssl/opensslv.h.in, crypto/cversion.c, crypto/err/err.c, providers/*prov.c, VERSION.dat. Items marked as general documentation were not checked against that commit.

Open questions

  • Unverified: a good byte signature for locating OPENSSL_VERSION_TEXT in a stripped static link is the ASCII prefix OpenSSL followed by a digit; test against several 1.1.1, 3.0 and 3.x builds.