summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/md2
diff options
context:
space:
mode:
authordjm <>2008-09-06 12:17:54 +0000
committerdjm <>2008-09-06 12:17:54 +0000
commit38ce604e3cc97706b876b0525ddff0121115456d (patch)
tree7ccc28afe1789ea3dbedf72365f955d5b8e105b5 /src/lib/libcrypto/md2
parent12867252827c8efaa8ddd1fa3b3d6e321e2bcdef (diff)
downloadopenbsd-38ce604e3cc97706b876b0525ddff0121115456d.tar.gz
openbsd-38ce604e3cc97706b876b0525ddff0121115456d.tar.bz2
openbsd-38ce604e3cc97706b876b0525ddff0121115456d.zip
resolve conflicts
Diffstat (limited to 'src/lib/libcrypto/md2')
-rw-r--r--src/lib/libcrypto/md2/md2.h12
-rw-r--r--src/lib/libcrypto/md2/md2_dgst.c12
-rw-r--r--src/lib/libcrypto/md2/md2_one.c2
-rw-r--r--src/lib/libcrypto/md2/md2test.c6
4 files changed, 16 insertions, 16 deletions
diff --git a/src/lib/libcrypto/md2/md2.h b/src/lib/libcrypto/md2/md2.h
index d0ef9da08e..a46120e7d4 100644
--- a/src/lib/libcrypto/md2/md2.h
+++ b/src/lib/libcrypto/md2/md2.h
@@ -59,13 +59,14 @@
59#ifndef HEADER_MD2_H 59#ifndef HEADER_MD2_H
60#define HEADER_MD2_H 60#define HEADER_MD2_H
61 61
62#include <openssl/opensslconf.h> /* OPENSSL_NO_MD2, MD2_INT */
62#ifdef OPENSSL_NO_MD2 63#ifdef OPENSSL_NO_MD2
63#error MD2 is disabled. 64#error MD2 is disabled.
64#endif 65#endif
66#include <stddef.h>
65 67
66#define MD2_DIGEST_LENGTH 16 68#define MD2_DIGEST_LENGTH 16
67#define MD2_BLOCK 16 69#define MD2_BLOCK 16
68#include <openssl/opensslconf.h> /* MD2_INT */
69 70
70#ifdef __cplusplus 71#ifdef __cplusplus
71extern "C" { 72extern "C" {
@@ -73,20 +74,17 @@ extern "C" {
73 74
74typedef struct MD2state_st 75typedef struct MD2state_st
75 { 76 {
76 int num; 77 unsigned int num;
77 unsigned char data[MD2_BLOCK]; 78 unsigned char data[MD2_BLOCK];
78 MD2_INT cksm[MD2_BLOCK]; 79 MD2_INT cksm[MD2_BLOCK];
79 MD2_INT state[MD2_BLOCK]; 80 MD2_INT state[MD2_BLOCK];
80 } MD2_CTX; 81 } MD2_CTX;
81 82
82const char *MD2_options(void); 83const char *MD2_options(void);
83#ifdef OPENSSL_FIPS
84int private_MD2_Init(MD2_CTX *c);
85#endif
86int MD2_Init(MD2_CTX *c); 84int MD2_Init(MD2_CTX *c);
87int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len); 85int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len);
88int MD2_Final(unsigned char *md, MD2_CTX *c); 86int MD2_Final(unsigned char *md, MD2_CTX *c);
89unsigned char *MD2(const unsigned char *d, unsigned long n,unsigned char *md); 87unsigned char *MD2(const unsigned char *d, size_t n,unsigned char *md);
90#ifdef __cplusplus 88#ifdef __cplusplus
91} 89}
92#endif 90#endif
diff --git a/src/lib/libcrypto/md2/md2_dgst.c b/src/lib/libcrypto/md2/md2_dgst.c
index 8124acd687..6f68b25c6a 100644
--- a/src/lib/libcrypto/md2/md2_dgst.c
+++ b/src/lib/libcrypto/md2/md2_dgst.c
@@ -62,10 +62,8 @@
62#include <openssl/md2.h> 62#include <openssl/md2.h>
63#include <openssl/opensslv.h> 63#include <openssl/opensslv.h>
64#include <openssl/crypto.h> 64#include <openssl/crypto.h>
65#include <openssl/fips.h>
66#include <openssl/err.h>
67 65
68const char *MD2_version="MD2" OPENSSL_VERSION_PTEXT; 66const char MD2_version[]="MD2" OPENSSL_VERSION_PTEXT;
69 67
70/* Implemented from RFC1319 The MD2 Message-Digest Algorithm 68/* Implemented from RFC1319 The MD2 Message-Digest Algorithm
71 */ 69 */
@@ -118,7 +116,7 @@ const char *MD2_options(void)
118 return("md2(int)"); 116 return("md2(int)");
119 } 117 }
120 118
121FIPS_NON_FIPS_MD_Init(MD2) 119int MD2_Init(MD2_CTX *c)
122 { 120 {
123 c->num=0; 121 c->num=0;
124 memset(c->state,0,sizeof c->state); 122 memset(c->state,0,sizeof c->state);
@@ -127,7 +125,7 @@ FIPS_NON_FIPS_MD_Init(MD2)
127 return 1; 125 return 1;
128 } 126 }
129 127
130int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len) 128int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len)
131 { 129 {
132 register UCHAR *p; 130 register UCHAR *p;
133 131
@@ -147,7 +145,7 @@ int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len)
147 } 145 }
148 else 146 else
149 { 147 {
150 memcpy(&(p[c->num]),data,(int)len); 148 memcpy(&(p[c->num]),data,len);
151 /* data+=len; */ 149 /* data+=len; */
152 c->num+=(int)len; 150 c->num+=(int)len;
153 return 1; 151 return 1;
@@ -161,7 +159,7 @@ int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len)
161 data+=MD2_BLOCK; 159 data+=MD2_BLOCK;
162 len-=MD2_BLOCK; 160 len-=MD2_BLOCK;
163 } 161 }
164 memcpy(p,data,(int)len); 162 memcpy(p,data,len);
165 c->num=(int)len; 163 c->num=(int)len;
166 return 1; 164 return 1;
167 } 165 }
diff --git a/src/lib/libcrypto/md2/md2_one.c b/src/lib/libcrypto/md2/md2_one.c
index 8c36ba5779..f7fef5cc0a 100644
--- a/src/lib/libcrypto/md2/md2_one.c
+++ b/src/lib/libcrypto/md2/md2_one.c
@@ -63,7 +63,7 @@
63/* This is a separate file so that #defines in cryptlib.h can 63/* This is a separate file so that #defines in cryptlib.h can
64 * map my MD functions to different names */ 64 * map my MD functions to different names */
65 65
66unsigned char *MD2(const unsigned char *d, unsigned long n, unsigned char *md) 66unsigned char *MD2(const unsigned char *d, size_t n, unsigned char *md)
67 { 67 {
68 MD2_CTX c; 68 MD2_CTX c;
69 static unsigned char m[MD2_DIGEST_LENGTH]; 69 static unsigned char m[MD2_DIGEST_LENGTH];
diff --git a/src/lib/libcrypto/md2/md2test.c b/src/lib/libcrypto/md2/md2test.c
index 9c1e28b6ce..db5f5bc6d2 100644
--- a/src/lib/libcrypto/md2/md2test.c
+++ b/src/lib/libcrypto/md2/md2test.c
@@ -110,7 +110,7 @@ int main(int argc, char *argv[])
110 i=1; 110 i=1;
111 while (*P != NULL) 111 while (*P != NULL)
112 { 112 {
113 EVP_Digest((unsigned char *)*P,(unsigned long)strlen(*P),md,NULL,EVP_md2(), NULL); 113 EVP_Digest((unsigned char *)*P,strlen(*P),md,NULL,EVP_md2(), NULL);
114 p=pt(md); 114 p=pt(md);
115 if (strcmp(p,*R) != 0) 115 if (strcmp(p,*R) != 0)
116 { 116 {
@@ -124,7 +124,11 @@ int main(int argc, char *argv[])
124 R++; 124 R++;
125 P++; 125 P++;
126 } 126 }
127#ifdef OPENSSL_SYS_NETWARE
128 if (err) printf("ERROR: %d\n", err);
129#endif
127 EXIT(err); 130 EXIT(err);
131 return err;
128 } 132 }
129 133
130static char *pt(unsigned char *md) 134static char *pt(unsigned char *md)