summaryrefslogtreecommitdiff
path: root/devel/tcl-trf/files/patch-digest
diff options
context:
space:
mode:
authorMikhail Teterin <mi@FreeBSD.org>2009-07-13 05:30:15 +0000
committerMikhail Teterin <mi@FreeBSD.org>2009-07-13 05:30:15 +0000
commit52b76e132728a3a0e13436f09f10391aec3e259b (patch)
tree8034266eeceaa3f8301733562c746f4e853afb28 /devel/tcl-trf/files/patch-digest
parent- Update to 1.1.1 (diff)
Resurrect this port from the Attic based on the new version from the
author. As before, we modify the author's code to use either OpenSSL's -lcrypto or BSD's -lmd /directly/ instead of compiling the bundled definitions digests. We also link with -lz and -lbz2 instead of dlopen-ing them at run-time.
Notes
Notes: svn path=/head/; revision=237667
Diffstat (limited to 'devel/tcl-trf/files/patch-digest')
-rw-r--r--devel/tcl-trf/files/patch-digest108
1 files changed, 108 insertions, 0 deletions
diff --git a/devel/tcl-trf/files/patch-digest b/devel/tcl-trf/files/patch-digest
new file mode 100644
index 000000000000..c86cd6a65a6b
--- /dev/null
+++ b/devel/tcl-trf/files/patch-digest
@@ -0,0 +1,108 @@
+--- generic/digest.c 2009-06-18 00:54:43.000000000 -0400
++++ generic/digest.c 2009-07-12 23:59:49.000000000 -0400
+@@ -34,4 +34,7 @@
+ * Declarations of internal procedures.
+ */
++static void Update _ANSI_ARGS_ ((Trf_MessageDigestDescription *md,
++ VOID* context,
++ unsigned int character));
+
+ static Trf_ControlBlock CreateEncoder _ANSI_ARGS_ ((ClientData writeClientData,
+@@ -236,4 +239,29 @@
+
+ /*
++ *
++ * Update
++ *
++ * ------------------------------------------------*
++ * If a back-end defines its own single-byte update
++ * function -- call it. Otherwise, call the back-end's
++ * updateBuf function with our single byte being the
++ * buffer.
++ * ------------------------------------------------*
++ *
++ */
++static void
++Update(Trf_MessageDigestDescription *md, VOID* context,
++ unsigned int character)
++{
++ if (md->updateProc != NULL)
++ md->updateProc(context, character);
++ else {
++ unsigned char buf = character;
++
++ md->updateBufProc(context, &buf, 1);
++ }
++}
++
++/*
+ *------------------------------------------------------*
+ *
+@@ -378,5 +406,5 @@
+
+ buf = character;
+- (*md->updateProc) (c->context, character);
++ Update(md, c->context, character);
+
+ if ((c->operation_mode == ATTACH_ABSORB) ||
+@@ -430,5 +458,5 @@
+ for (i=0; i < ((unsigned int) bufLen); i++) {
+ character = buffer [i];
+- (*md->updateProc) (c->context, character);
++ Update(md, c->context, character);
+ }
+ }
+@@ -481,5 +509,5 @@
+ */
+ digest = (char*) ckalloc (2 + md->digest_size);
+- (*md->finalProc) (c->context, digest);
++ (*md->finalProc) (digest, c->context);
+
+ if ((c->operation_mode == ATTACH_WRITE) ||
+@@ -671,9 +699,9 @@
+ if (c->operation_mode == ATTACH_WRITE) {
+ buf = character;
+- (*md->updateProc) (c->context, character);
++ Update(md, c->context, character);
+
+ } else if (c->operation_mode == ATTACH_TRANS) {
+ buf = character;
+- (*md->updateProc) (c->context, character);
++ Update(md, c->context, character);
+
+ return c->write (c->writeClientData, (unsigned char*) &buf, 1, interp);
+@@ -692,5 +720,5 @@
+
+ character = buf;
+- (*md->updateProc) (c->context, character);
++ Update(md, c->context, character);
+
+ return c->write (c->writeClientData, (unsigned char*) &buf, 1, interp);
+@@ -748,5 +776,5 @@
+ for (i=0; i < bufLen; i++) {
+ character = buffer [i];
+- (*md->updateProc) (c->context, character);
++ Update(md, c->context, character);
+ }
+ }
+@@ -760,5 +788,5 @@
+ for (i=0; i < bufLen; i++) {
+ character = buffer [i];
+- (*md->updateProc) (c->context, character);
++ Update(md, c->context, character);
+ }
+ }
+@@ -924,5 +952,5 @@
+ */
+ digest = (char*) ckalloc (2 + md->digest_size);
+- (*md->finalProc) (c->context, digest);
++ (*md->finalProc) (digest, c->context);
+
+ if ((c->operation_mode == ATTACH_WRITE) ||
+@@ -1040,5 +1068,5 @@
+
+ #if GT81
+- Tcl_Obj* digestObj = Tcl_NewByteArrayObj (digest, md->digest_size);
++ Tcl_Obj* digestObj = Tcl_NewByteArrayObj ((void *)digest, md->digest_size);
+ #else
+ Tcl_Obj* digestObj = Tcl_NewStringObj (digest, md->digest_size);