[packages/libgda5] - rel 12; fix openssl build

arekm arekm at pld-linux.org
Thu Sep 20 13:58:21 CEST 2018


commit e6be00c784d0ba90b1e8abaa8813db06a380592e
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Sep 20 13:58:14 2018 +0200

    - rel 12; fix openssl build

 libgda5.spec  |  4 +++-
 openssl.patch | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 58 insertions(+), 1 deletion(-)
---
diff --git a/libgda5.spec b/libgda5.spec
index a770836..dd680e9 100644
--- a/libgda5.spec
+++ b/libgda5.spec
@@ -23,7 +23,7 @@ Summary:	GNU Data Access library
 Summary(pl.UTF-8):	Biblioteka GNU Data Access
 Name:		libgda5
 Version:	5.2.4
-Release:	11
+Release:	12
 License:	LGPL v2+/GPL v2+
 Group:		Libraries
 Source0:	http://ftp.gnome.org/pub/GNOME/sources/libgda/5.2/libgda-%{version}.tar.xz
@@ -38,6 +38,7 @@ Patch6:		java8.patch
 Patch7:		vapigen-detect.patch
 Patch8:		%{name}-sqlite.patch
 Patch9:		convert-files-to-unicode.patch
+Patch10:	openssl.patch
 URL:		http://www.gnome-db.org/
 %{?with_firebird:BuildRequires:	Firebird-devel}
 BuildRequires:	autoconf >= 2.68
@@ -395,6 +396,7 @@ Narzędzia graficzne dla GDA.
 %patch7 -p1
 %patch8 -p1
 %patch9 -p1
+%patch10 -p1
 
 %build
 # included version is bash-specific, use system file
diff --git a/openssl.patch b/openssl.patch
new file mode 100644
index 0000000..61906bd
--- /dev/null
+++ b/openssl.patch
@@ -0,0 +1,55 @@
+--- libgda-5.2.4/providers/sqlcipher/sqlite3.c.org	2015-06-13 11:10:56.000000000 +0200
++++ libgda-5.2.4/providers/sqlcipher/sqlite3.c	2018-09-20 13:39:30.385033922 +0200
+@@ -15696,14 +15696,16 @@ static int sqlcipher_openssl_random (voi
+ }
+ 
+ static int sqlcipher_openssl_hmac(void *ctx, unsigned char *hmac_key, int key_sz, unsigned char *in, int in_sz, unsigned char *in2, int in2_sz, unsigned char *out) {
+-  HMAC_CTX hctx;
++  HMAC_CTX *hctx;
+   unsigned int outlen;
+-  HMAC_CTX_init(&hctx);
+-  HMAC_Init_ex(&hctx, hmac_key, key_sz, EVP_sha1(), NULL);
+-  HMAC_Update(&hctx, in, in_sz);
+-  HMAC_Update(&hctx, in2, in2_sz);
+-  HMAC_Final(&hctx, out, &outlen);
+-  HMAC_CTX_cleanup(&hctx);
++  hctx = HMAC_CTX_new();
++  if (hctx == NULL)
++    return SQLITE_NOMEM;
++  HMAC_Init_ex(hctx, hmac_key, key_sz, EVP_sha1(), NULL);
++  HMAC_Update(hctx, in, in_sz);
++  HMAC_Update(hctx, in2, in2_sz);
++  HMAC_Final(hctx, out, &outlen);
++  HMAC_CTX_free(hctx);
+   return SQLITE_OK; 
+ }
+ 
+@@ -15713,18 +15715,21 @@ static int sqlcipher_openssl_kdf(void *c
+ }
+ 
+ static int sqlcipher_openssl_cipher(void *ctx, int mode, unsigned char *key, int key_sz, unsigned char *iv, unsigned char *in, int in_sz, unsigned char *out) {
+-  EVP_CIPHER_CTX ectx;
++  EVP_CIPHER_CTX *ectx;
+   int tmp_csz, csz;
+  
+-  EVP_CipherInit(&ectx, ((openssl_ctx *)ctx)->evp_cipher, NULL, NULL, mode);
+-  EVP_CIPHER_CTX_set_padding(&ectx, 0); // no padding
+-  EVP_CipherInit(&ectx, NULL, key, iv, mode);
+-  EVP_CipherUpdate(&ectx, out, &tmp_csz, in, in_sz);
++  ectx = EVP_CIPHER_CTX_new();
++  if (ectx == NULL)
++    return SQLITE_NOMEM;
++  EVP_CipherInit(ectx, ((openssl_ctx *)ctx)->evp_cipher, NULL, NULL, mode);
++  EVP_CIPHER_CTX_set_padding(ectx, 0); // no padding
++  EVP_CipherInit(ectx, NULL, key, iv, mode);
++  EVP_CipherUpdate(ectx, out, &tmp_csz, in, in_sz);
+   csz = tmp_csz;  
+   out += tmp_csz;
+-  EVP_CipherFinal(&ectx, out, &tmp_csz);
++  EVP_CipherFinal(ectx, out, &tmp_csz);
+   csz += tmp_csz;
+-  EVP_CIPHER_CTX_cleanup(&ectx);
++  EVP_CIPHER_CTX_free(ectx);
+   assert(in_sz == csz);
+   return SQLITE_OK; 
+ }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libgda5.git/commitdiff/e6be00c784d0ba90b1e8abaa8813db06a380592e



More information about the pld-cvs-commit mailing list