[packages/ghasher] - fix format-security error - openssl-1.1.0 buildfixes - release 6
adamg
adamg at pld-linux.org
Mon Oct 1 23:14:47 CEST 2018
commit 24874e74533160722d777f9ff31878fac30b3511
Author: Adam Gołębiowski <adamg at pld-linux.org>
Date: Mon Oct 1 23:13:59 2018 +0200
- fix format-security error
- openssl-1.1.0 buildfixes
- release 6
ghasher-format-security.patch | 11 +++++++++
ghasher-openssl-1.1.0.patch | 57 +++++++++++++++++++++++++++++++++++++++++++
ghasher.spec | 6 ++++-
3 files changed, 73 insertions(+), 1 deletion(-)
---
diff --git a/ghasher.spec b/ghasher.spec
index 054d72e..f30dcc3 100644
--- a/ghasher.spec
+++ b/ghasher.spec
@@ -2,13 +2,15 @@ Summary: MD5 sum utility
Summary(pl.UTF-8): Narzędzie do obliczania sum MD5
Name: ghasher
Version: 1.2.1
-Release: 5
+Release: 6
License: BSD
Group: X11/Applications
Source0: http://asgaard.homelinux.org/code/ghasher/%{name}-%{version}.tar.gz
# Source0-md5: 36edeaf03bd8827d2a96db86735532fb
Patch0: %{name}-Makefile.patch
Patch1: %{name}-desktop.patch
+Patch2: %{name}-format-security.patch
+Patch3: %{name}-openssl-1.1.0.patch
URL: http://asgaard.homelinux.org/code/ghasher/
BuildRequires: gtk+2-devel >= 1:2.0.0
BuildRequires: libglade2-devel
@@ -27,6 +29,8 @@ ghasher to małe narzędzie do obliczania sum MD5/SHA-1 i wielu innych.
%setup -q
%patch0 -p1
%patch1 -p1
+%patch2 -p1
+%patch3 -p1
%build
%{__make} \
diff --git a/ghasher-format-security.patch b/ghasher-format-security.patch
new file mode 100644
index 0000000..e0c7a0a
--- /dev/null
+++ b/ghasher-format-security.patch
@@ -0,0 +1,11 @@
+--- ghasher-1.2.1.orig/util.c 2005-11-22 18:04:54.000000000 +0100
++++ ghasher-1.2.1/util.c 2018-10-01 23:01:20.506110007 +0200
+@@ -15,7 +15,7 @@
+ va_start(args, message);
+ res = g_strdup_vprintf(message, args);
+ va_end(args);
+- dialog = gtk_message_dialog_new(GTK_WINDOW(mainWindow), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, res);
++ dialog = gtk_message_dialog_new(GTK_WINDOW(mainWindow), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", res);
+ g_free(res);
+ gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE);
+ gtk_dialog_run(GTK_DIALOG(dialog));
diff --git a/ghasher-openssl-1.1.0.patch b/ghasher-openssl-1.1.0.patch
new file mode 100644
index 0000000..d42a043
--- /dev/null
+++ b/ghasher-openssl-1.1.0.patch
@@ -0,0 +1,57 @@
+--- ghasher-1.2.1.orig/ghasher.h 2005-11-22 18:23:33.000000000 +0100
++++ ghasher-1.2.1/ghasher.h 2018-10-01 23:03:11.071926945 +0200
+@@ -27,7 +27,7 @@
+
+ struct SumContext {
+ struct GHApp *app;
+- EVP_MD_CTX ctx;
++ EVP_MD_CTX *ctx;
+ const EVP_MD *md;
+ int currentfile;
+ struct stat statbuf;
+--- ghasher-1.2.1.orig/gui.c 2005-11-22 18:25:01.000000000 +0100
++++ ghasher-1.2.1/gui.c 2018-10-01 23:11:24.751262326 +0200
+@@ -63,14 +63,16 @@
+
+ if (s_ctx->allok) {
+ #if OPENSSL_VERSION_NUMBER >= 0x00907000L
+- EVP_DigestFinal(&s_ctx->ctx, b, &md_len);
++ EVP_DigestFinal(s_ctx->ctx, b, &md_len);
+ #endif
+ hex_dump(b, md_len, b_hex, md_len * 2 + 1);
+ set_hashfield(GTK_TREE_VIEW(s_ctx->app->listview), b_hex, g_ptr_array_index(s_ctx->app->files, s_ctx->app->currentfile - 1));
+
+ }
+-#if OPENSSL_VERSION_NUMBER >= 0x00907000L
+- EVP_MD_CTX_cleanup(&s_ctx->ctx);
++#if OPENSSL_VERSION_NUMBER < 0x10100005L
++ EVP_MD_CTX_destroy(s_ctx->ctx);
++#else
++ EVP_MD_CTX_free(s_ctx->ctx);
+ #endif
+ g_free(s_ctx);
+ }
+@@ -102,8 +104,12 @@
+ return NULL;
+
+ }
+-
+- EVP_DigestInit(&s_ctx->ctx, s_ctx->md);
++#if OPENSSL_VERSION_NUMBER < 0x10100005L
++ s_ctx->ctx = EVP_MD_CTX_create();
++#else
++ s_ctx->ctx = EVP_MD_CTX_new();
++#endif
++ EVP_DigestInit(s_ctx->ctx, s_ctx->md);
+ s_ctx->currentfile = open(filename, O_RDONLY);
+ if (s_ctx->currentfile < 0) {
+ gchar *error;
+@@ -160,7 +166,7 @@
+
+ ret = read(s_ctx->currentfile, buffer, s_ctx->statbuf.st_blksize * BLOCKSZ);
+ if (ret > 0) {
+- EVP_DigestUpdate(&s_ctx->ctx, buffer, (unsigned long) ret);
++ EVP_DigestUpdate(s_ctx->ctx, buffer, (unsigned long) ret);
+ s_ctx->read_acc += (off_t) ret;
+ } else if (ret == 0) {
+ s_ctx->allok = TRUE;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/ghasher.git/commitdiff/24874e74533160722d777f9ff31878fac30b3511
More information about the pld-cvs-commit
mailing list