aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devel/objecthash/files/patch-Makefile15
-rw-r--r--devel/objecthash/files/patch-objecthash.c38
-rw-r--r--devel/objecthash/files/patch-objecthash.h13
3 files changed, 66 insertions, 0 deletions
diff --git a/devel/objecthash/files/patch-Makefile b/devel/objecthash/files/patch-Makefile
new file mode 100644
index 000000000000..2f7b1e084a5b
--- /dev/null
+++ b/devel/objecthash/files/patch-Makefile
@@ -0,0 +1,15 @@
+--- Makefile.orig 2016-08-01 17:37:31 UTC
++++ Makefile
+@@ -14,10 +14,10 @@ java:
+ sbt test
+
+ objecthash_test: libobjecthash.so
+- $(CC) -std=c99 -Wall -Werror -o objecthash_test objecthash_test.c -lobjecthash -L. -Wl,-rpath -Wl,.
++ $(CC) ${CFLAGS} -std=c99 -Wall -Werror -o objecthash_test objecthash_test.c -lobjecthash -L. -Wl,-rpath -Wl,.
+
+ libobjecthash.so: objecthash.c
+- $(CC) -fPIC -shared -std=c99 -Wall -Werror -o libobjecthash.so objecthash.c -lcrypto `pkg-config --libs --cflags icu-uc json-c`
++ $(CC) ${CFLAGS} -fPIC -shared -std=c99 -Wall -Werror -o libobjecthash.so objecthash.c -lcrypto `pkg-config --libs --cflags icu-uc json-c`
+
+ get:
+ GOPATH=`pwd` go get golang.org/x/text/unicode/norm
diff --git a/devel/objecthash/files/patch-objecthash.c b/devel/objecthash/files/patch-objecthash.c
new file mode 100644
index 000000000000..662fc230e3fc
--- /dev/null
+++ b/devel/objecthash/files/patch-objecthash.c
@@ -0,0 +1,38 @@
+--- objecthash.c.orig 2018-09-25 21:01:54 UTC
++++ objecthash.c
+@@ -13,7 +13,7 @@
+
+ #include "objecthash.h"
+
+-bool object_hash(/*const*/ json_object *j, byte hash[HASH_SIZE]);
++bool object_hash(/*const*/ json_object *j, byte hash[SHA256_DIGEST_LENGTH]);
+
+ static void hash_update(hash_ctx * const c, const byte * const b,
+ const size_t l) {
+@@ -45,7 +45,7 @@ static int dict_comp(const void *a, const void *b) {
+ return memcmp(a, b, 2 * sizeof(hash));
+ }
+
+-static bool object_hash_str(const char *str, size_t len, byte hash[HASH_SIZE]) {
++static bool object_hash_str(const char *str, size_t len, byte hash[SHA256_DIGEST_LENGTH]) {
+ hash_bytes('u', (const byte *)str, len, hash);
+ return true;
+ }
+@@ -147,7 +147,7 @@ static bool object_hash_list(json_object *l, hash h) {
+
+ int len = json_object_array_length(l);
+ for (int n = 0; n < len; ++n) {
+- byte ihash[HASH_SIZE];
++ byte ihash[SHA256_DIGEST_LENGTH];
+ if (!object_hash(json_object_array_get_idx(l, n), ihash))
+ return false;
+ hash_update(&ctx, ihash, sizeof ihash);
+@@ -157,7 +157,7 @@ static bool object_hash_list(json_object *l, hash h) {
+ return true;
+ }
+
+-bool object_hash(/*const*/ json_object *j, byte hash[HASH_SIZE]) {
++bool object_hash(/*const*/ json_object *j, byte hash[SHA256_DIGEST_LENGTH]) {
+ enum json_type type;
+ type = json_object_get_type(j);
+ switch (type) {
diff --git a/devel/objecthash/files/patch-objecthash.h b/devel/objecthash/files/patch-objecthash.h
new file mode 100644
index 000000000000..6d926ed1002f
--- /dev/null
+++ b/devel/objecthash/files/patch-objecthash.h
@@ -0,0 +1,13 @@
+--- objecthash.h.orig 2018-09-25 20:58:11 UTC
++++ objecthash.h
+@@ -8,9 +8,7 @@ extern "C" {
+
+ typedef unsigned char byte;
+
+-static const int HASH_SIZE = SHA256_DIGEST_LENGTH;
+-
+-typedef byte hash[HASH_SIZE];
++typedef byte hash[SHA256_DIGEST_LENGTH];
+ typedef SHA256_CTX hash_ctx;
+
+ bool python_json_hash(const char *json, hash h);