]> git.sur5r.net Git - bacula/bacula/commitdiff
crypto: Use DEFINE_STACK_OF()
authorSebastian Andrzej Siewior <sebastian@breakpoint.cc>
Wed, 8 Nov 2017 13:42:22 +0000 (14:42 +0100)
committerKern Sibbald <kern@sibbald.com>
Sun, 19 Nov 2017 15:54:35 +0000 (16:54 +0100)
OpenSSL 1.1 makes it possible to use DEFINE_STACK_OF() instead of
IMPLEMENT_STACK_OF() + mkstack.pl's output.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
bacula/src/lib/crypto.c

index c172efb2b5d9a4e8b671a597835ffb665505d329..4b9f0f2a2f3a9a4a8b2087f20131be1f9bf274e8 100644 (file)
@@ -194,9 +194,11 @@ IMPLEMENT_ASN1_FUNCTIONS(SignerInfo)
 IMPLEMENT_ASN1_FUNCTIONS(RecipientInfo)
 IMPLEMENT_ASN1_FUNCTIONS(SignatureData)
 IMPLEMENT_ASN1_FUNCTIONS(CryptoData)
-IMPLEMENT_STACK_OF(SignerInfo)
-IMPLEMENT_STACK_OF(RecipientInfo)
 
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
+DEFINE_STACK_OF(SignerInfo);
+DEFINE_STACK_OF(RecipientInfo);
+#else
 /*
  * SignerInfo and RecipientInfo stack macros, generated by OpenSSL's util/mkstack.pl.
  */
@@ -260,6 +262,7 @@ IMPLEMENT_STACK_OF(RecipientInfo)
 #define ASN1_seq_unpack_RecipientInfo(buf, len, d2i_func, free_func) \
         SKM_ASN1_seq_unpack(RecipientInfo, (buf), (len), (d2i_func), (free_func))
 /* End of util/mkstack.pl block */
+#endif
 
 /* X509 Public/Private Key Pair Structure */
 struct X509_Keypair {