aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authormiwi <miwi@FreeBSD.org>2007-05-29 22:54:04 +0800
committermiwi <miwi@FreeBSD.org>2007-05-29 22:54:04 +0800
commitf1f96ea82492116ce84b186692738692a0e3ad62 (patch)
treeaa7756458c7808edf51f2a3dac57033bfbe4d393 /security
parent022133983a222026cc79e22994eb68f0c0bbed57 (diff)
downloadfreebsd-ports-gnome-f1f96ea82492116ce84b186692738692a0e3ad62.tar.gz
freebsd-ports-gnome-f1f96ea82492116ce84b186692738692a0e3ad62.tar.zst
freebsd-ports-gnome-f1f96ea82492116ce84b186692738692a0e3ad62.zip
- Add a patch for output the correct checksum for the null string.
PR: 112553 Submitted by: Ighighi<ighighi@gmail.com> Obtained from: pkgsrc
Diffstat (limited to 'security')
-rw-r--r--security/digest/files/patch-triger.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/security/digest/files/patch-triger.c b/security/digest/files/patch-triger.c
new file mode 100644
index 000000000000..bd1085bab41c
--- /dev/null
+++ b/security/digest/files/patch-triger.c
@@ -0,0 +1,62 @@
+--- tiger.c.orig Tue May 8 06:31:30 2007
++++ tiger.c Tue May 8 08:07:57 2007
+@@ -646,12 +646,16 @@
+ TIGER_COMPRESS_MACRO(((const uint64_t *) str), ((uint64_t *) state));
+ }
+
++static uint64_t init_state[3] = {
++ 0x0123456789ABCDEFLL, 0xFEDCBA9876543210LL, 0xF096A5B4C3B2E187LL
++};
++
+ void
+ TIGERInit(tiger_context_t *tp)
+ {
+- tp->ctx[0] = 0x0123456789ABCDEFLL;
+- tp->ctx[1] = 0xFEDCBA9876543210LL;
+- tp->ctx[2] = 0xF096A5B4C3B2E187LL;
++ tp->ctx[0] = init_state[0];
++ tp->ctx[1] = init_state[1];
++ tp->ctx[2] = init_state[2];
+ }
+
+ void
+@@ -708,10 +712,27 @@
+ tiger_compress(((uint64_t *) temp), tp->ctx);
+ }
+
++#define PUT_64BIT_BE(cp, value) do { \
++ (cp)[0] = (value) >> 56; \
++ (cp)[1] = (value) >> 48; \
++ (cp)[2] = (value) >> 40; \
++ (cp)[3] = (value) >> 32; \
++ (cp)[4] = (value) >> 24; \
++ (cp)[5] = (value) >> 16; \
++ (cp)[6] = (value) >> 8; \
++ (cp)[7] = (value); } while (0)
++
+ void
+ TIGERFinal(uint8_t *digest, tiger_context_t *tp)
+ {
+- /* nothing to do - included for compatibility with SHA* interface */
++ int i;
++
++ if (tp->ctx[0] == init_state[0] && tp->ctx[1] == init_state[1] &&
++ tp->ctx[2] == init_state[2])
++ TIGERUpdate(tp, "", 0);
++
++ for (i = 0; i < 3; i++)
++ PUT_64BIT_BE(digest + i * 8, tp->ctx[i]);
+ }
+
+ static void
+@@ -734,6 +755,9 @@
+ if (buf == NULL && (buf = malloc(41)) == NULL) {
+ return NULL;
+ }
++ if (tp->ctx[0] == init_state[0] && tp->ctx[1] == init_state[1] &&
++ tp->ctx[2] == init_state[2])
++ TIGERUpdate(tp, "", 0);
+
+ for (i = 0; i < 3; ++i)
+ print_uint64(buf + i * 16, tp->ctx[i]);
+