summaryrefslogtreecommitdiff
path: root/freefilesync/ffs_openssl.patch
blob: b77d8acd550aaa91dcb4f71de12ed8b1d057806b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Summary: Compile for libss-dev 1.1.1m
Author: bgstack15
Date: 2022-06-07
Version: 11.16
Message: Compile on any distro with openssl < 3.0.0
diff -aur 11.13/zen/open_ssl.cpp 11.14/zen/open_ssl.cpp
--- 11.16-0/zen/open_ssl.cpp	2022-01-04 10:04:34.135914294 -0500
+++ 11.16-1/zen/open_ssl.cpp	2022-01-04 10:29:12.544451067 -0500
@@ -201,7 +201,7 @@
 
 //================================================================================
 
-std::string keyToStream(const EVP_PKEY* evp, RsaStreamType streamType, bool publicKey) //throw SysError
+std::string keyToStream(EVP_PKEY* evp, RsaStreamType streamType, bool publicKey) //throw SysError
 {
     //assert(::EVP_PKEY_get_base_id(evp) == EVP_PKEY_RSA);
 
@@ -210,7 +210,7 @@
         case RsaStreamType::pkix:
         {
             //fix OpenSSL API inconsistencies:
-            auto PEM_write_bio_PrivateKey2 = [](BIO* bio, const EVP_PKEY* key)
+            auto PEM_write_bio_PrivateKey2 = [](BIO* bio, EVP_PKEY* key)
             {
                 return ::PEM_write_bio_PrivateKey(bio,      //BIO* bp
                                                   key,      //const EVP_PKEY* x
@@ -269,7 +269,7 @@
             return {reinterpret_cast<const char*>(keyBuf), keyLen};
 #else
             //fix OpenSSL API inconsistencies:
-            auto PEM_write_bio_RSAPrivateKey2 = [](BIO* bio, const RSA* rsa)
+            auto PEM_write_bio_RSAPrivateKey2 = [](BIO* bio, RSA* rsa)
             {
                 return ::PEM_write_bio_RSAPrivateKey(bio,      //BIO* bp
                                                      rsa,      //const RSA* x
@@ -279,14 +279,14 @@
                                                      nullptr,  //pem_password_cb* cb
                                                      nullptr); //void* u
             };
-            auto PEM_write_bio_RSAPublicKey2 = [](BIO* bio, const RSA* rsa) { return ::PEM_write_bio_RSAPublicKey(bio, rsa); };
+            auto PEM_write_bio_RSAPublicKey2 = [](BIO* bio, RSA* rsa) { return ::PEM_write_bio_RSAPublicKey(bio, rsa); };
 
             BIO* bio = ::BIO_new(BIO_s_mem());
             if (!bio)
                 throw SysError(formatLastOpenSSLError("BIO_new"));
             ZEN_ON_SCOPE_EXIT(::BIO_free_all(bio));
 
-            const RSA* rsa = ::EVP_PKEY_get0_RSA(evp); //unowned reference!
+            RSA* rsa = ::EVP_PKEY_get0_RSA(evp); //unowned reference!
             if (!rsa)
                 throw SysError(formatLastOpenSSLError("EVP_PKEY_get0_RSA"));
 
bgstack15