haskell-cryptography / HsOpenSSL

OpenSSL binding for Haskell
http://hackage.haskell.org/package/HsOpenSSL
Creative Commons Zero v1.0 Universal
21 stars 30 forks source link

HsOpenSSL 0.11.7.1 fails to link against openssl 3.0.0 #62

Closed loqs closed 2 years ago

loqs commented 2 years ago

With openssl 3.0.0 some functions were renamed, their old names were deprecated and supplied by defines referencing the new names. This means the old names can not be linked against. This impacts SSL_get_peer_certificate new name SSL_get1_peer_certificate 1 and EVP_PKEY_base_id new name EVP_PKEY_get_base_id 3.

Current build output:

Configuring HsOpenSSL-0.11.7.1...
Preprocessing library for HsOpenSSL-0.11.7.1..
Building library for HsOpenSSL-0.11.7.1..
[ 1 of 33] Compiling OpenSSL          ( OpenSSL.hs, dist/build/OpenSSL.dyn_o )
[ 2 of 33] Compiling OpenSSL.DH.Internal ( OpenSSL/DH/Internal.hs, dist/build/OpenSSL/DH/Internal.dyn_o )
[ 3 of 33] Compiling OpenSSL.ERR      ( OpenSSL/ERR.hs, dist/build/OpenSSL/ERR.dyn_o )
[ 4 of 33] Compiling OpenSSL.EVP.Base64 ( OpenSSL/EVP/Base64.hs, dist/build/OpenSSL/EVP/Base64.dyn_o )
[ 5 of 33] Compiling OpenSSL.Objects  ( dist/build/OpenSSL/Objects.hs, dist/build/OpenSSL/Objects.dyn_o )
[ 6 of 33] Compiling OpenSSL.SSL.Option ( dist/build/OpenSSL/SSL/Option.hs, dist/build/OpenSSL/SSL/Option.dyn_o )
[ 7 of 33] Compiling OpenSSL.Stack    ( dist/build/OpenSSL/Stack.hs, dist/build/OpenSSL/Stack.dyn_o )
[ 8 of 33] Compiling OpenSSL.Utils    ( OpenSSL/Utils.hs, dist/build/OpenSSL/Utils.dyn_o )
[ 9 of 33] Compiling OpenSSL.Random   ( OpenSSL/Random.hs, dist/build/OpenSSL/Random.dyn_o )
[10 of 33] Compiling OpenSSL.EVP.Internal ( dist/build/OpenSSL/EVP/Internal.hs, dist/build/OpenSSL/EVP/Internal.dyn_o )
[11 of 33] Compiling OpenSSL.EVP.Digest ( dist/build/OpenSSL/EVP/Digest.hs, dist/build/OpenSSL/EVP/Digest.dyn_o )
[12 of 33] Compiling OpenSSL.EVP.Cipher ( OpenSSL/EVP/Cipher.hs, dist/build/OpenSSL/EVP/Cipher.dyn_o )
[13 of 33] Compiling OpenSSL.Cipher   ( dist/build/OpenSSL/Cipher.hs, dist/build/OpenSSL/Cipher.dyn_o )
[14 of 33] Compiling OpenSSL.BN       ( dist/build/OpenSSL/BN.hs, dist/build/OpenSSL/BN.dyn_o )
[15 of 33] Compiling OpenSSL.RSA      ( dist/build/OpenSSL/RSA.hs, dist/build/OpenSSL/RSA.dyn_o )
[16 of 33] Compiling OpenSSL.DER      ( dist/build/OpenSSL/DER.hs, dist/build/OpenSSL/DER.dyn_o )
[17 of 33] Compiling OpenSSL.DSA      ( dist/build/OpenSSL/DSA.hs, dist/build/OpenSSL/DSA.dyn_o )
[18 of 33] Compiling OpenSSL.EVP.PKey ( dist/build/OpenSSL/EVP/PKey.hs, dist/build/OpenSSL/EVP/PKey.dyn_o )
[19 of 33] Compiling OpenSSL.EVP.Verify ( OpenSSL/EVP/Verify.hs, dist/build/OpenSSL/EVP/Verify.dyn_o )
[20 of 33] Compiling OpenSSL.EVP.Sign ( OpenSSL/EVP/Sign.hs, dist/build/OpenSSL/EVP/Sign.dyn_o )
[21 of 33] Compiling OpenSSL.EVP.Seal ( OpenSSL/EVP/Seal.hs, dist/build/OpenSSL/EVP/Seal.dyn_o )
[22 of 33] Compiling OpenSSL.EVP.Open ( OpenSSL/EVP/Open.hs, dist/build/OpenSSL/EVP/Open.dyn_o )
[23 of 33] Compiling OpenSSL.DH       ( OpenSSL/DH.hs, dist/build/OpenSSL/DH.dyn_o )
[24 of 33] Compiling OpenSSL.BIO      ( OpenSSL/BIO.hs, dist/build/OpenSSL/BIO.dyn_o )
[25 of 33] Compiling OpenSSL.ASN1     ( dist/build/OpenSSL/ASN1.hs, dist/build/OpenSSL/ASN1.dyn_o )
[26 of 33] Compiling OpenSSL.X509.Name ( dist/build/OpenSSL/X509/Name.hs, dist/build/OpenSSL/X509/Name.dyn_o )
[27 of 33] Compiling OpenSSL.X509     ( dist/build/OpenSSL/X509.hs, dist/build/OpenSSL/X509.dyn_o )
[28 of 33] Compiling OpenSSL.X509.Request ( OpenSSL/X509/Request.hs, dist/build/OpenSSL/X509/Request.dyn_o )
[29 of 33] Compiling OpenSSL.X509.Revocation ( dist/build/OpenSSL/X509/Revocation.hs, dist/build/OpenSSL/X509/Revocation.dyn_o )
[30 of 33] Compiling OpenSSL.X509.Store ( dist/build/OpenSSL/X509/Store.hs, dist/build/OpenSSL/X509/Store.dyn_o )
[31 of 33] Compiling OpenSSL.Session  ( dist/build/OpenSSL/Session.hs, dist/build/OpenSSL/Session.dyn_o )
[32 of 33] Compiling OpenSSL.PKCS7    ( dist/build/OpenSSL/PKCS7.hs, dist/build/OpenSSL/PKCS7.dyn_o )
[33 of 33] Compiling OpenSSL.PEM      ( OpenSSL/PEM.hs, dist/build/OpenSSL/PEM.dyn_o )
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_DHparams_dup’:

cbits/HsOpenSSL.c:57:5: error:
     warning: ‘DHparams_dup’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
       57 |     return DHparams_dup(dh);
          |     ^~~~~~
   |
57 |     return DHparams_dup(dh);
   |     ^
In file included from cbits/HsOpenSSL.h:3,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dh.h:190:1: error:
     note: declared here
      190 | DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, DH, DHparams)
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |
190 | DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, DH, DHparams)
    | ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_HMAC_CTX_new’:

cbits/HsOpenSSL.c:76:5: error:
     warning: ‘HMAC_CTX_new’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
       76 |     return HMAC_CTX_new();
          |     ^~~~~~
   |
76 |     return HMAC_CTX_new();
   |     ^
In file included from cbits/HsOpenSSL.h:9,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/hmac.h:33:33: error:
     note: declared here
       33 | OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void);
          |                                 ^~~~~~~~~~~~
   |
33 | OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void);
   |                                 ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_HMAC_CTX_free’:

cbits/HsOpenSSL.c:86:5: error:
     warning: ‘HMAC_CTX_free’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
       86 |     HMAC_CTX_free(ctx);
          |     ^~~~~~~~~~~~~
   |
86 |     HMAC_CTX_free(ctx);
   |     ^
In file included from cbits/HsOpenSSL.h:9,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/hmac.h:35:28: error:
     note: declared here
       35 | OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_free(HMAC_CTX *ctx);
          |                            ^~~~~~~~~~~~~
   |
35 | OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_free(HMAC_CTX *ctx);
   |                            ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_DH_get_pub_key’:

cbits/HsOpenSSL.c:185:5: error:
     warning: ‘DH_get0_key’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
      185 |     DH_get0_key(dh, pub_key, priv_key);
          |     ^~~~~~~~~~~
    |
185 |     DH_get0_key(dh, pub_key, priv_key);
    |     ^
In file included from cbits/HsOpenSSL.h:6,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dh.h:256:28: error:
     note: declared here
      256 | OSSL_DEPRECATEDIN_3_0 void DH_get0_key(const DH *dh, const BIGNUM **pub_key,
          |                            ^~~~~~~~~~~
    |
256 | OSSL_DEPRECATEDIN_3_0 void DH_get0_key(const DH *dh, const BIGNUM **pub_key,
    |                            ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_DH_length’:

cbits/HsOpenSSL.c:197:5: error:
     warning: ‘DH_get0_pqg’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
      197 |     DH_get0_pqg(dh, p, q, g);
          |     ^~~~~~~~~~~
    |
197 |     DH_get0_pqg(dh, p, q, g);
    |     ^
In file included from cbits/HsOpenSSL.h:6,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dh.h:253:28: error:
     note: declared here
      253 | OSSL_DEPRECATEDIN_3_0 void DH_get0_pqg(const DH *dh, const BIGNUM **p,
          |                            ^~~~~~~~~~~
    |
253 | OSSL_DEPRECATEDIN_3_0 void DH_get0_pqg(const DH *dh, const BIGNUM **p,
    |                            ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_dsa_sign’:

cbits/HsOpenSSL.c:303:3: error:
     warning: ‘DSA_do_sign’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
      303 |   DSA_SIG *const sig = DSA_do_sign(ddata, dlen, dsa);
          |   ^~~~~~~
    |
303 |   DSA_SIG *const sig = DSA_do_sign(ddata, dlen, dsa);
    |   ^
In file included from /usr/include/openssl/x509.h:37,
                 from /usr/include/openssl/pem.h:23,
                 from cbits/HsOpenSSL.h:14,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dsa.h:113:32: error:
     note: declared here
      113 | OSSL_DEPRECATEDIN_3_0 DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen,
          |                                ^~~~~~~~~~~
    |
113 | OSSL_DEPRECATEDIN_3_0 DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen,
    |                                ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_dsa_verify’:

cbits/HsOpenSSL.c:325:3: error:
     warning: ‘DSA_do_verify’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
      325 |   int res = DSA_do_verify(ddata, dlen, sig, dsa);
          |   ^~~
    |
325 |   int res = DSA_do_verify(ddata, dlen, sig, dsa);
    |   ^
In file included from /usr/include/openssl/x509.h:37,
                 from /usr/include/openssl/pem.h:23,
                 from cbits/HsOpenSSL.h:14,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dsa.h:115:27: error:
     note: declared here
      115 | OSSL_DEPRECATEDIN_3_0 int DSA_do_verify(const unsigned char *dgst, int dgst_len,
          |                           ^~~~~~~~~~~~~
    |
115 | OSSL_DEPRECATEDIN_3_0 int DSA_do_verify(const unsigned char *dgst, int dgst_len,
    |                           ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_DSAPublicKey_dup’:

cbits/HsOpenSSL.c:349:5: error:
     warning: ‘i2d_DSAPublicKey’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
      349 |     return DSAPublicKey_dup(dsa);
          |     ^~~~~~
    |
349 |     return DSAPublicKey_dup(dsa);
    |     ^
In file included from cbits/HsOpenSSL.h:3,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dsa.h:148:1: error:
     note: declared here
      148 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |
148 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
    | ^

cbits/HsOpenSSL.c:349:5: error:
     warning: ‘d2i_DSAPublicKey’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
      349 |     return DSAPublicKey_dup(dsa);
          |     ^~~~~~
    |
349 |     return DSAPublicKey_dup(dsa);
    |     ^
In file included from cbits/HsOpenSSL.h:3,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dsa.h:148:1: error:
     note: declared here
      148 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |
148 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
    | ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_DSAPrivateKey_dup’:

cbits/HsOpenSSL.c:353:5: error:
     warning: ‘i2d_DSAPrivateKey’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
      353 |     return DSAPrivateKey_dup(dsa);
          |     ^~~~~~
    |
353 |     return DSAPrivateKey_dup(dsa);
    |     ^
In file included from cbits/HsOpenSSL.h:3,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dsa.h:150:1: error:
     note: declared here
      150 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |
150 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
    | ^

cbits/HsOpenSSL.c:353:5: error:
     warning: ‘d2i_DSAPrivateKey’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
      353 |     return DSAPrivateKey_dup(dsa);
          |     ^~~~~~
    |
353 |     return DSAPrivateKey_dup(dsa);
    |     ^
In file included from cbits/HsOpenSSL.h:3,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dsa.h:150:1: error:
     note: declared here
      150 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |
150 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
    | ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_DHparams_dup’:

cbits/HsOpenSSL.c:57:5: error:
     warning: ‘DHparams_dup’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
       57 |     return DHparams_dup(dh);
          |     ^~~~~~
   |
57 |     return DHparams_dup(dh);
   |     ^
In file included from cbits/HsOpenSSL.h:3,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dh.h:190:1: error:
     note: declared here
      190 | DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, DH, DHparams)
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |
190 | DECLARE_ASN1_DUP_FUNCTION_name_attr(OSSL_DEPRECATEDIN_3_0, DH, DHparams)
    | ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_HMAC_CTX_new’:

cbits/HsOpenSSL.c:76:5: error:
     warning: ‘HMAC_CTX_new’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
       76 |     return HMAC_CTX_new();
          |     ^~~~~~
   |
76 |     return HMAC_CTX_new();
   |     ^
In file included from cbits/HsOpenSSL.h:9,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/hmac.h:33:33: error:
     note: declared here
       33 | OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void);
          |                                 ^~~~~~~~~~~~
   |
33 | OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void);
   |                                 ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_HMAC_CTX_free’:

cbits/HsOpenSSL.c:86:5: error:
     warning: ‘HMAC_CTX_free’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
       86 |     HMAC_CTX_free(ctx);
          |     ^~~~~~~~~~~~~
   |
86 |     HMAC_CTX_free(ctx);
   |     ^
In file included from cbits/HsOpenSSL.h:9,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/hmac.h:35:28: error:
     note: declared here
       35 | OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_free(HMAC_CTX *ctx);
          |                            ^~~~~~~~~~~~~
   |
35 | OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_free(HMAC_CTX *ctx);
   |                            ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_DH_get_pub_key’:

cbits/HsOpenSSL.c:185:5: error:
     warning: ‘DH_get0_key’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
      185 |     DH_get0_key(dh, pub_key, priv_key);
          |     ^~~~~~~~~~~
    |
185 |     DH_get0_key(dh, pub_key, priv_key);
    |     ^
In file included from cbits/HsOpenSSL.h:6,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dh.h:256:28: error:
     note: declared here
      256 | OSSL_DEPRECATEDIN_3_0 void DH_get0_key(const DH *dh, const BIGNUM **pub_key,
          |                            ^~~~~~~~~~~
    |
256 | OSSL_DEPRECATEDIN_3_0 void DH_get0_key(const DH *dh, const BIGNUM **pub_key,
    |                            ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_DH_length’:

cbits/HsOpenSSL.c:197:5: error:
     warning: ‘DH_get0_pqg’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
      197 |     DH_get0_pqg(dh, p, q, g);
          |     ^~~~~~~~~~~
    |
197 |     DH_get0_pqg(dh, p, q, g);
    |     ^
In file included from cbits/HsOpenSSL.h:6,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dh.h:253:28: error:
     note: declared here
      253 | OSSL_DEPRECATEDIN_3_0 void DH_get0_pqg(const DH *dh, const BIGNUM **p,
          |                            ^~~~~~~~~~~
    |
253 | OSSL_DEPRECATEDIN_3_0 void DH_get0_pqg(const DH *dh, const BIGNUM **p,
    |                            ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_dsa_sign’:

cbits/HsOpenSSL.c:303:3: error:
     warning: ‘DSA_do_sign’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
      303 |   DSA_SIG *const sig = DSA_do_sign(ddata, dlen, dsa);
          |   ^~~~~~~
    |
303 |   DSA_SIG *const sig = DSA_do_sign(ddata, dlen, dsa);
    |   ^
In file included from /usr/include/openssl/x509.h:37,
                 from /usr/include/openssl/pem.h:23,
                 from cbits/HsOpenSSL.h:14,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dsa.h:113:32: error:
     note: declared here
      113 | OSSL_DEPRECATEDIN_3_0 DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen,
          |                                ^~~~~~~~~~~
    |
113 | OSSL_DEPRECATEDIN_3_0 DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen,
    |                                ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_dsa_verify’:

cbits/HsOpenSSL.c:325:3: error:
     warning: ‘DSA_do_verify’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
      325 |   int res = DSA_do_verify(ddata, dlen, sig, dsa);
          |   ^~~
    |
325 |   int res = DSA_do_verify(ddata, dlen, sig, dsa);
    |   ^
In file included from /usr/include/openssl/x509.h:37,
                 from /usr/include/openssl/pem.h:23,
                 from cbits/HsOpenSSL.h:14,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dsa.h:115:27: error:
     note: declared here
      115 | OSSL_DEPRECATEDIN_3_0 int DSA_do_verify(const unsigned char *dgst, int dgst_len,
          |                           ^~~~~~~~~~~~~
    |
115 | OSSL_DEPRECATEDIN_3_0 int DSA_do_verify(const unsigned char *dgst, int dgst_len,
    |                           ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_DSAPublicKey_dup’:

cbits/HsOpenSSL.c:349:5: error:
     warning: ‘i2d_DSAPublicKey’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
      349 |     return DSAPublicKey_dup(dsa);
          |     ^~~~~~
    |
349 |     return DSAPublicKey_dup(dsa);
    |     ^
In file included from cbits/HsOpenSSL.h:3,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dsa.h:148:1: error:
     note: declared here
      148 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |
148 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
    | ^

cbits/HsOpenSSL.c:349:5: error:
     warning: ‘d2i_DSAPublicKey’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
      349 |     return DSAPublicKey_dup(dsa);
          |     ^~~~~~
    |
349 |     return DSAPublicKey_dup(dsa);
    |     ^
In file included from cbits/HsOpenSSL.h:3,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dsa.h:148:1: error:
     note: declared here
      148 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |
148 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
    | ^
cbits/HsOpenSSL.c: In function ‘HsOpenSSL_DSAPrivateKey_dup’:

cbits/HsOpenSSL.c:353:5: error:
     warning: ‘i2d_DSAPrivateKey’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
      353 |     return DSAPrivateKey_dup(dsa);
          |     ^~~~~~
    |
353 |     return DSAPrivateKey_dup(dsa);
    |     ^
In file included from cbits/HsOpenSSL.h:3,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dsa.h:150:1: error:
     note: declared here
      150 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |
150 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
    | ^

cbits/HsOpenSSL.c:353:5: error:
     warning: ‘d2i_DSAPrivateKey’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
      353 |     return DSAPrivateKey_dup(dsa);
          |     ^~~~~~
    |
353 |     return DSAPrivateKey_dup(dsa);
    |     ^
In file included from cbits/HsOpenSSL.h:3,

                 from cbits/HsOpenSSL.c:2:0: error: 

/usr/include/openssl/dsa.h:150:1: error:
     note: declared here
      150 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |
150 | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,
    | ^
Preprocessing test suite 'test-evp-digest' for HsOpenSSL-0.11.7.1..
Building test suite 'test-evp-digest' for HsOpenSSL-0.11.7.1..
[1 of 2] Compiling TestUtils        ( Test/OpenSSL/TestUtils.hs, dist/build/test-evp-digest/test-evp-digest-tmp/TestUtils.dyn_o )
[2 of 2] Compiling Main             ( Test/OpenSSL/EVP/Digest.hs, dist/build/test-evp-digest/test-evp-digest-tmp/Main.dyn_o )
Linking dist/build/test-evp-digest/test-evp-digest ...
/build/haskell-hsopenssl/src/HsOpenSSL-0.11.7.1/dist/build/libHSHsOpenSSL-0.11.7.1-8ZigorzIzlV7GHJMtImfup-ghc8.10.5.so: error: undefined reference to 'SSL_get_peer_certificate'
/build/haskell-hsopenssl/src/HsOpenSSL-0.11.7.1/dist/build/libHSHsOpenSSL-0.11.7.1-8ZigorzIzlV7GHJMtImfup-ghc8.10.5.so: error: undefined reference to 'EVP_PKEY_base_id'
collect2: error: ld returned 1 exit status
`cc' failed in phase `Linker'. (Exit code: 1)
vshabanov commented 2 years ago

I don't have OpenSSL 3.0 at hand but I've added a small fix for these two functions. Could you, please, whether last commit works for you?

loqs commented 2 years ago

Fixed by 27d152a98032f8a6fde09d3387c3b4bb8f0e6448 Thank you for the very fast response.

vshabanov commented 2 years ago

Just published HsOpenSSL-0.11.7.2 with this fix on Hackage