summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/md2/md2_dgst.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/md2/md2_dgst.c')
-rw-r--r--src/lib/libcrypto/md2/md2_dgst.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/libcrypto/md2/md2_dgst.c b/src/lib/libcrypto/md2/md2_dgst.c
index 6f68b25c6a..8124acd687 100644
--- a/src/lib/libcrypto/md2/md2_dgst.c
+++ b/src/lib/libcrypto/md2/md2_dgst.c
@@ -62,8 +62,10 @@
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>
65 67
66const char MD2_version[]="MD2" OPENSSL_VERSION_PTEXT; 68const char *MD2_version="MD2" OPENSSL_VERSION_PTEXT;
67 69
68/* Implemented from RFC1319 The MD2 Message-Digest Algorithm 70/* Implemented from RFC1319 The MD2 Message-Digest Algorithm
69 */ 71 */
@@ -116,7 +118,7 @@ const char *MD2_options(void)
116 return("md2(int)"); 118 return("md2(int)");
117 } 119 }
118 120
119int MD2_Init(MD2_CTX *c) 121FIPS_NON_FIPS_MD_Init(MD2)
120 { 122 {
121 c->num=0; 123 c->num=0;
122 memset(c->state,0,sizeof c->state); 124 memset(c->state,0,sizeof c->state);
@@ -125,7 +127,7 @@ int MD2_Init(MD2_CTX *c)
125 return 1; 127 return 1;
126 } 128 }
127 129
128int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len) 130int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len)
129 { 131 {
130 register UCHAR *p; 132 register UCHAR *p;
131 133
@@ -145,7 +147,7 @@ int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len)
145 } 147 }
146 else 148 else
147 { 149 {
148 memcpy(&(p[c->num]),data,len); 150 memcpy(&(p[c->num]),data,(int)len);
149 /* data+=len; */ 151 /* data+=len; */
150 c->num+=(int)len; 152 c->num+=(int)len;
151 return 1; 153 return 1;
@@ -159,7 +161,7 @@ int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len)
159 data+=MD2_BLOCK; 161 data+=MD2_BLOCK;
160 len-=MD2_BLOCK; 162 len-=MD2_BLOCK;
161 } 163 }
162 memcpy(p,data,len); 164 memcpy(p,data,(int)len);
163 c->num=(int)len; 165 c->num=(int)len;
164 return 1; 166 return 1;
165 } 167 }