ports/devel/tcl-trf/files/patch-md2
Mikhail Teterin 8ad0c3adab Resolve a few more symbols at compile/link time, rather than at
run-time. This  fixes the  bz2 commands.  We link  against -lmd,  so use
<md2.h>  and <md5.h>,  instead  of <openssl/md[25].h>  (why  do we  even
install those separately?). Bump up portrevision.

Change the reference (in the comment) from -lscrypt to -lcrypt.
2002-02-17 16:03:11 +00:00

131 lines
2.7 KiB
Text
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--- generic/md2.c Wed Aug 9 15:13:17 2000
+++ generic/md2.c Fri Feb 15 14:55:50 2002
@@ -30,13 +30,8 @@
#include "loadman.h"
-/*
- * Generator description
- * ---------------------
- *
- * The MD2 alogrithm is used to compute a cryptographically strong
- * message digest.
- */
+#include <sys/types.h>
+#include <md2.h>
-#define DIGEST_SIZE (MD2_DIGEST_LENGTH)
+#define DIGEST_SIZE 16
#define CTX_TYPE MD2_CTX
@@ -59,9 +54,9 @@
sizeof (CTX_TYPE),
DIGEST_SIZE,
- MDmd2_Start,
+ MD2Init,
MDmd2_Update,
- MDmd2_UpdateBuf,
+ MD2Update,
MDmd2_Final,
- MDmd2_Check
+ NULL
};
@@ -94,30 +89,4 @@
*------------------------------------------------------*
*
- * MDmd2_Start --
- *
- * ------------------------------------------------*
- * Initialize the internal state of the message
- * digest generator.
- * ------------------------------------------------*
- *
- * Sideeffects:
- * As of the called procedure.
- *
- * Result:
- * None.
- *
- *------------------------------------------------------*
- */
-
-static void
-MDmd2_Start (context)
-VOID* context;
-{
- md2f.init ((MD2_CTX*) context);
-}
-
-/*
- *------------------------------------------------------*
- *
* MDmd2_Update --
*
@@ -143,33 +112,5 @@
unsigned char buf = character;
- md2f.update ((MD2_CTX*) context, &buf, 1);
-}
-
-/*
- *------------------------------------------------------*
- *
- * MDmd2_UpdateBuf --
- *
- * ------------------------------------------------*
- * Update the internal state of the message digest
- * generator for a character buffer.
- * ------------------------------------------------*
- *
- * Sideeffects:
- * As of the called procedure.
- *
- * Result:
- * None.
- *
- *------------------------------------------------------*
- */
-
-static void
-MDmd2_UpdateBuf (context, buffer, bufLen)
-VOID* context;
-unsigned char* buffer;
-int bufLen;
-{
- md2f.update ((MD2_CTX*) context, (unsigned char*) buffer, bufLen);
+ MD2Update ((MD2_CTX*) context, &buf, 1);
}
@@ -198,31 +139,4 @@
VOID* digest;
{
- md2f.final ((unsigned char*) digest, (MD2_CTX*) context);
-}
-
-/*
- *------------------------------------------------------*
- *
- * MDmd2_Check --
- *
- * ------------------------------------------------*
- * Do global one-time initializations of the message
- * digest generator.
- * ------------------------------------------------*
- *
- * Sideeffects:
- * Loads the shared library containing the
- * MD2 functionality
- *
- * Result:
- * A standard Tcl error code.
- *
- *------------------------------------------------------*
- */
-
-static int
-MDmd2_Check (interp)
-Tcl_Interp* interp;
-{
- return TrfLoadMD2 (interp);
+ MD2Final ((unsigned char*) digest, (MD2_CTX*) context);
}