summaryrefslogtreecommitdiff
path: root/devel/tcl-trf/files/patch-md2
blob: e9702c18fba9a476c40ec226afbb984df50a8ceb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
--- generic/md2.c	Wed Aug  9 15:13:17 2000
+++ generic/md2.c	Sat Jul 10 17:43:07 2004
@@ -28,4 +28,6 @@
  */
 
+#include <sys/types.h>
+#include <openssl/md2.h>
 #include "loadman.h"
 
@@ -38,5 +40,5 @@
  */
 
-#define DIGEST_SIZE               (MD2_DIGEST_LENGTH)
+#define DIGEST_SIZE               (16)
 #define CTX_TYPE                  MD2_CTX
 
@@ -45,9 +47,6 @@
  */
 
-static void MDmd2_Start     _ANSI_ARGS_ ((VOID* context));
 static void MDmd2_Update    _ANSI_ARGS_ ((VOID* context, unsigned int character));
-static void MDmd2_UpdateBuf _ANSI_ARGS_ ((VOID* context, unsigned char* buffer, int bufLen));
 static void MDmd2_Final     _ANSI_ARGS_ ((VOID* context, VOID* digest));
-static int  MDmd2_Check     _ANSI_ARGS_ ((Tcl_Interp* interp));
 
 /*
@@ -59,9 +58,9 @@
   sizeof (CTX_TYPE),
   DIGEST_SIZE,
-  MDmd2_Start,
+  (Trf_MDStart *)MD2_Init,
   MDmd2_Update,
-  MDmd2_UpdateBuf,
+  (Trf_MDUpdateBuf *)MD2_Update,
   MDmd2_Final,
-  MDmd2_Check
+  NULL
 };
 
@@ -94,30 +93,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 +116,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);
+  MD2_Update ((MD2_CTX*) context, &buf, 1);
 }
 
@@ -198,31 +143,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);
+  MD2_Final ((unsigned char*) digest, (MD2_CTX*) context);
 }