summaryrefslogtreecommitdiff
path: root/lib/libssl/src/crypto/md2/md2_dgst.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libssl/src/crypto/md2/md2_dgst.c')
-rw-r--r--lib/libssl/src/crypto/md2/md2_dgst.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/libssl/src/crypto/md2/md2_dgst.c b/lib/libssl/src/crypto/md2/md2_dgst.c
index 608baefa8f3..e25dd00e026 100644
--- a/lib/libssl/src/crypto/md2/md2_dgst.c
+++ b/lib/libssl/src/crypto/md2/md2_dgst.c
@@ -115,19 +115,20 @@ const char *MD2_options(void)
return("md2(int)");
}
-void MD2_Init(MD2_CTX *c)
+int MD2_Init(MD2_CTX *c)
{
c->num=0;
memset(c->state,0,MD2_BLOCK*sizeof(MD2_INT));
memset(c->cksm,0,MD2_BLOCK*sizeof(MD2_INT));
memset(c->data,0,MD2_BLOCK);
+ return 1;
}
-void MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len)
+int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len)
{
register UCHAR *p;
- if (len == 0) return;
+ if (len == 0) return 1;
p=c->data;
if (c->num != 0)
@@ -146,7 +147,7 @@ void MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len)
memcpy(&(p[c->num]),data,(int)len);
/* data+=len; */
c->num+=(int)len;
- return;
+ return 1;
}
}
/* we now can process the input data in blocks of MD2_BLOCK
@@ -159,6 +160,7 @@ void MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len)
}
memcpy(p,data,(int)len);
c->num=(int)len;
+ return 1;
}
static void md2_block(MD2_CTX *c, const unsigned char *d)
@@ -197,7 +199,7 @@ static void md2_block(MD2_CTX *c, const unsigned char *d)
memset(state,0,48*sizeof(MD2_INT));
}
-void MD2_Final(unsigned char *md, MD2_CTX *c)
+int MD2_Final(unsigned char *md, MD2_CTX *c)
{
int i,v;
register UCHAR *cp;
@@ -219,5 +221,6 @@ void MD2_Final(unsigned char *md, MD2_CTX *c)
for (i=0; i<16; i++)
md[i]=(UCHAR)(p1[i]&0xff);
memset((char *)&c,0,sizeof(c));
+ return 1;
}