]> git.cameronkatri.com Git - ldid.git/commitdiff
Fix < OpenSSL 3.0.0 build
authorCameron Katri <me@cameronkatri.com>
Mon, 11 Oct 2021 17:45:40 +0000 (13:45 -0400)
committerCameron Katri <me@cameronkatri.com>
Mon, 11 Oct 2021 17:45:40 +0000 (13:45 -0400)
ldid.cpp

index f8360d32d9c8380ba371827cf882ec62c6849a31..08dcf5551fda72fd212b9065c6f21a8959767318 100644 (file)
--- a/ldid.cpp
+++ b/ldid.cpp
 #include <sys/types.h>
 
 #ifndef LDID_NOSMIME
+#include <openssl/opensslv.h>
+# if OPENSSL_VERSION_NUM >= 0x30000000
 #include <openssl/provider.h>
+# endif
 #include <openssl/err.h>
 #include <openssl/pem.h>
 #include <openssl/pkcs7.h>
@@ -3121,8 +3124,10 @@ static void usage(const char *argv0) {
 int main(int argc, char *argv[]) {
 #ifndef LDID_NOSMIME
     OpenSSL_add_all_algorithms();
+# if OPENSSL_VERSION_NUM >= 0x30000000
     OSSL_PROVIDER *legacy = OSSL_PROVIDER_load(NULL, "legacy");
     OSSL_PROVIDER *deflt = OSSL_PROVIDER_load(NULL, "default");
+# endif
 #endif
 
     union {
@@ -3602,8 +3607,10 @@ int main(int argc, char *argv[]) {
     }
 
 #ifndef LDID_NOSMINE
+# if OPENSSL_VERSION_NUM >= 0x30000000
     OSSL_PROVIDER_unload(legacy);
     OSSL_PROVIDER_unload(deflt);
+# endif
 #endif
 
     return filee;