$ git show --format=fuller --patch-with-stat --summary 7f220efd78b94ac3a09777ff9220618bb23988ea
commit 7f220efd78b94ac3a09777ff9220618bb23988ea
Author: Crispin Boylan <crisb@mandriva.org>
AuthorDate: Sat Nov 16 20:11:29 2019 +0000
Commit: Crispin Boylan <crisb@mandriva.org>
CommitDate: Sat Nov 16 20:11:29 2019 +0000
Fix build with some patches
---
f08178e5de0d31cbd9bf17ab541a621a6f1f93fc.patch | 31 ++++++
rdup-nettle3.5.patch | 133 +++++++++++++++++++++++++
rdup.spec | 9 +-
3 files changed, 170 insertions(+), 3 deletions(-)
create mode 100644 f08178e5de0d31cbd9bf17ab541a621a6f1f93fc.patch
create mode 100644 rdup-nettle3.5.patch
diff --git a/f08178e5de0d31cbd9bf17ab541a621a6f1f93fc.patch b/f08178e5de0d31cbd9bf17ab541a621a6f1f93fc.patch
new file mode 100644
index 0000000..3c76399
--- /dev/null
+++ b/f08178e5de0d31cbd9bf17ab541a621a6f1f93fc.patch
@@ -0,0 +1,31 @@
+From f08178e5de0d31cbd9bf17ab541a621a6f1f93fc Mon Sep 17 00:00:00 2001
+From: Niko Pavlinek <niko.pavlinek@gmail.com>
+Date: Sun, 10 Nov 2019 00:52:28 +0100
+Subject: [PATCH] Replace deprecated calls to g_memmove with memmove
+
+---
+ crypt.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/crypt.c b/crypt.c
+index d61ca7e..fd9a74b 100644
+--- a/crypt.c
++++ b/crypt.c
+@@ -88,7 +88,7 @@ gchar *crypt_path_ele(struct aes_ctx * ctx, gchar * elem, GHashTable * tr)
+ source = g_malloc0(aes_size);
+ dest = g_malloc0(aes_size);
+
+- g_memmove(source, elem, len);
++ memmove(source, elem, len);
+ aes_encrypt(ctx, aes_size, dest, source);
+
+ b64 = encode_base64(aes_size, dest);
+@@ -136,7 +136,7 @@ gchar *decrypt_path_ele(struct aes_ctx * ctx, char *b64, GHashTable * tr)
+ source = g_malloc0(aes_size);
+ dest = g_malloc0(aes_size);
+
+- g_memmove(source, crypt, crypt_size);
++ memmove(source, crypt, crypt_size);
+ aes_decrypt(ctx, aes_size, dest, source);
+
+ g_free(source);
diff --git a/rdup-nettle3.5.patch b/rdup-nettle3.5.patch
new file mode 100644
index 0000000..fa4de10
--- /dev/null
+++ b/rdup-nettle3.5.patch
@@ -0,0 +1,133 @@
+diff -ur rdup-1.1.15.orig/crypt.c rdup-1.1.15/crypt.c
+--- rdup-1.1.15.orig/crypt.c 2019-11-16 20:05:36.196229046 +0000
++++ rdup-1.1.15/crypt.c 2019-11-16 20:09:56.635212391 +0000
+@@ -18,19 +18,18 @@
+ * init the cryto
+ * with key *key
+ * and length length
+- * lenght MUST be 16, 24 or 32
++ * lenght MUST be 32
+ * anything short will be zero padded to
+ * create a correct key
+ * return aes context
+ */
+-struct aes_ctx *crypt_init(gchar * key, gboolean crypt)
++struct aes256_ctx *crypt_init(gchar * key, gboolean crypt)
+ {
+- guint length = strlen(key);
+- struct aes_ctx *ctx = g_malloc(sizeof(struct aes_ctx));
++ struct aes256_ctx *ctx = g_malloc(sizeof(struct aes256_ctx));
+ if (crypt)
+- aes_set_encrypt_key(ctx, length, (uint8_t *) key);
++ aes256_set_encrypt_key(ctx, (uint8_t *) key);
+ else
+- aes_set_decrypt_key(ctx, length, (uint8_t *) key);
++ aes256_set_decrypt_key(ctx, (uint8_t *) key);
+ return ctx;
+ }
+
+@@ -70,7 +69,7 @@
+ /* encrypt and base64 encode path element
+ * return the result
+ */
+-gchar *crypt_path_ele(struct aes_ctx * ctx, gchar * elem, GHashTable * tr)
++gchar *crypt_path_ele(struct aes256_ctx * ctx, gchar * elem, GHashTable * tr)
+ {
+ guint aes_size, len;
+ guchar *source;
+@@ -89,7 +88,7 @@
+ dest = g_malloc0(aes_size);
+
+ memmove(source, elem, len);
+- aes_encrypt(ctx, aes_size, dest, source);
++ aes256_encrypt(ctx, aes_size, dest, source);
+
+ b64 = encode_base64(aes_size, dest);
+ g_free(source);
+@@ -111,7 +110,7 @@
+ /* decrypt and base64 decode path element
+ * return the result
+ */
+-gchar *decrypt_path_ele(struct aes_ctx * ctx, char *b64, GHashTable * tr)
++gchar *decrypt_path_ele(struct aes256_ctx * ctx, char *b64, GHashTable * tr)
+ {
+ guint aes_size, len;
+ guchar *source;
+@@ -137,7 +136,7 @@
+ dest = g_malloc0(aes_size);
+
+ memmove(source, crypt, crypt_size);
+- aes_decrypt(ctx, aes_size, dest, source);
++ aes256_decrypt(ctx, aes_size, dest, source);
+
+ g_free(source);
+ g_free(crypt);
+@@ -160,7 +159,7 @@
+ /**
+ * encrypt an entire path
+ */
+-gchar *crypt_path(struct aes_ctx * ctx, gchar * p, GHashTable * tr)
++gchar *crypt_path(struct aes256_ctx * ctx, gchar * p, GHashTable * tr)
+ {
+ gchar *q, *c, *t, *crypt, *xpath, *temp, d;
+ gboolean abs;
+@@ -221,7 +220,7 @@
+ /**
+ * decrypt an entire path
+ */
+-gchar *decrypt_path(struct aes_ctx * ctx, gchar * x, GHashTable * tr)
++gchar *decrypt_path(struct aes256_ctx * ctx, gchar * x, GHashTable * tr)
+ {
+
+ gchar *path, *q, *c, *t, *plain, *temp, d;
+@@ -282,7 +281,7 @@
+
+ /**
+ * Read the key from a file
+- * Key must be 16, 24 or 32 octets
++ * Key must be 32 octets
+ * Check for this - if larger than 32 cut it off
+ */
+ gchar *crypt_key(gchar * file)
+@@ -315,8 +314,8 @@
+ buf[32] = '\0';
+ return buf;
+ }
+- if (s != 16 && s != 24 && s != 32) {
+- msg(_("AES key must be 16, 24 or 32 bytes"));
++ if (s != 32) {
++ msg(_("AES key must be 32 bytes"));
+ g_free(buf);
+ return NULL;
+ }
+diff -ur rdup-1.1.15.orig/rdup-tr.c rdup-1.1.15/rdup-tr.c
+--- rdup-1.1.15.orig/rdup-tr.c 2016-03-02 15:39:44.000000000 +0000
++++ rdup-1.1.15/rdup-tr.c 2019-11-16 19:06:40.176538863 +0000
+@@ -21,7 +21,7 @@
+ #ifdef HAVE_LIBNETTLE
+ gchar *opt_crypt_key = NULL; /* encryption key */
+ gchar *opt_decrypt_key = NULL; /* decryption key */
+-struct aes_ctx *aes_ctx = NULL;
++struct aes256_ctx *aes_ctx = NULL;
+ #endif /* HAVE_LIBNETTLE */
+ gint opt_verbose = 0; /* be more verbose */
+ gint opt_output = O_RDUP; /* default output */
+diff -ur rdup-1.1.15.orig/rdup-tr.h.in rdup-1.1.15/rdup-tr.h.in
+--- rdup-1.1.15.orig/rdup-tr.h.in 2016-03-02 15:39:44.000000000 +0000
++++ rdup-1.1.15/rdup-tr.h.in 2019-11-16 19:02:11.262556059 +0000
+@@ -88,10 +88,10 @@
+ gchar *slink(struct rdup *);
+
+ /* crypt.c */
+-struct aes_ctx * crypt_init(gchar *, gboolean);
+-gchar * crypt_path_ele(struct aes_ctx *, gchar *, GHashTable *);
+-gchar * decrypt_path_ele(struct aes_ctx *, gchar *, GHashTable *);
+-gchar * crypt_path(struct aes_ctx *, gchar *, GHashTable *);
+-gchar * decrypt_path(struct aes_ctx *, gchar *, GHashTable *);
++struct aes256_ctx * crypt_init(gchar *, gboolean);
++gchar * crypt_path_ele(struct aes256_ctx *, gchar *, GHashTable *);
++gchar * decrypt_path_ele(struct aes256_ctx *, gchar *, GHashTable *);
++gchar * crypt_path(struct aes256_ctx *, gchar *, GHashTable *);
++gchar * decrypt_path(struct aes256_ctx *, gchar *, GHashTable *);
+ char * crypt_key(gchar *);
+ #endif /* _RDUP_TR_H */
diff --git a/rdup.spec b/rdup.spec
index 49bf1c9..d5c617e 100644
--- a/rdup.spec
+++ b/rdup.spec
@@ -3,8 +3,11 @@
Name: rdup
Summary: Rdup backup tool
Version: 1.1.15
-Release: 2
+Release: 4
Source0: http://github.com/miekg/rdup/releases/rdup-%{version}.tar.gz
+Patch1: f08178e5de0d31cbd9bf17ab541a621a6f1f93fc.patch
+# limit to aes256
+Patch2: rdup-nettle3.5.patch
URL: http://github.com/miekg/rdup
License: GPL
Group: Archiving/Backup
@@ -21,11 +24,11 @@ in a true Unix-way.
%prep
%setup -q
-%apply_patches
+%autopatch -p1
autoreconf -fiv
%build
-%configure2_5x
+%configure
make GCC='gcc %ldflags'
%install