OPENSSL_USER_MACROS(7SSL)

πŸ’… NAME πŸ’…

openssl_user_macros, OPENSSL_API_COMPAT, OPENSSL_NO_DEPRECATED β€” user defined macros, bestie. yes it's giving header-file sorcery and it's literally the manual page (7SSL, sshh, we got you).


✨ DESCRIPTION ✨

Okay so picture this: user defined macros are the little switches you get to flip that control certain aspects of what the OpenSSL headers actually expose to your code. They're not doing the crypto for you, they're deciding what even shows up at the party. πŸ‘‘

🚨 NOTE, and this part is not a vibe, it's a rule: to be effective, a user defined macro must be defined before you include any header file that depends on it. Two ways: in the compilation command (cc -DMACRO=value), or by defining the macro in your source before including any headers. Do it after and it's just… decorative. πŸ’€

Also, other manual pages may refer to this page when declarations depend on user defined macros. So when you see a "hey go read OPENSSL_USER_MACROS" in the docs, that's not a threat, that's just the receipt. 🧾

πŸŽ€ The macros πŸŽ€

  • OPENSSL_API_COMPAT β€” this one takes a value that's a version number, and you can write it in one of the following two forms:
    • "0xMNNFF000L" β€” this is the form that's supported for all versions up to 1.1.x. Break it down: M is the major number, NN is the minor number, and FF is the fix number, given as a hexadecimal number. So for version 1.1.0, that's 0x10100000L. 🌸

You can give any version number you want, but these are the current known major deprecation points, which makes them the most meaningful ones:

  • 0x00908000L (version 0.9.8)
  • 0x10000000L (version 1.0.0)
  • 0x10100000L (version 1.1.0)

And for convenience, higher numbers are accepted as well, as long as they're feasible. Like, for example, 0x60000000L will work as expected. Slay. However β€” and the docs are being so real about this β€” it is recommended to start using the second form instead. πŸ‘€

  • "mmnnpp" β€” this form is a simple decimal number, calculated with this formula:
major * 10000 + minor * 100 + patch

where major, minor and patch are the desired major, minor and patch components of the version number. For example:

30000 corresponds to version 3.0.0
10002 corresponds to version 1.0.2
420101 corresponds to version 42.1.1

(yes, 42.1.1. they knew what they were doing. πŸ¦‹)

If OPENSSL_API_COMPAT is undefined, this default value gets used in its place instead: 40000.

  • OPENSSL_NO_DEPRECATED β€” if this macro is defined, all deprecated public symbols in all OpenSSL versions up to and including the version given by OPENSSL_API_COMPAT (or the default value given above, when OPENSSL_API_COMPAT isn't defined) will be hidden. Gone. Blocked. Not even a read receipt. πŸ™ˆ
  • OPENSSL_ENGINE_STUBS β€” so the ENGINE API, as defined in openssl/engine.h, was permanently removed in OpenSSL 4.0. periodt. 😭

Your user application can use the define OPENSSL_ENGINE_STUBS to enable stub macros for API ENGINE functions. It should temporarily help the easy transition of applications without source code modifications. It's like a little emotional support shim. 🫢

⚠️ Note that all stub macros emulate API function failures. They will not restore the removed API, even if the OPENSSL_API_COMPAT define is used. So it's a bridge, not a resurrection. πŸ’€

Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


okay that's the whole page bestie, no cap, every flag and every version number accounted for πŸ’– and if you need the receipts: this is version 4.0.3, dated 2026-09-29, filed under OPENSSL_USER_MACROS(7SSL). now go define your macros before your includes. mwah. πŸ’…βœ¨

πŸ“¦ where this page comes from