aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/mdc2
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2001-03-08 14:04:22 +0000
committerDr. Stephen Henson <steve@openssl.org>2001-03-08 14:04:22 +0000
commit2dc769a1c17e1e0c7aef6e11496c8ba2c1db2e28 (patch)
tree47bc3c6bf378e59f79c418f9956b6ed03fc4c805 /crypto/mdc2
parent4f98cbabdeb50d548c83a8ca36014f3011461379 (diff)
downloadopenssl-2dc769a1c17e1e0c7aef6e11496c8ba2c1db2e28.tar.gz
Make EVP_Digest*() routines return a value.
TODO: update docs, and make soe other routines which use EVP_Digest*() check return codes.
Diffstat (limited to 'crypto/mdc2')
-rw-r--r--crypto/mdc2/mdc2.h6
-rw-r--r--crypto/mdc2/mdc2dgst.c11
2 files changed, 10 insertions, 7 deletions
diff --git a/crypto/mdc2/mdc2.h b/crypto/mdc2/mdc2.h
index a23f58afaf..c4a81831bf 100644
--- a/crypto/mdc2/mdc2.h
+++ b/crypto/mdc2/mdc2.h
@@ -81,9 +81,9 @@ typedef struct mdc2_ctx_st
} MDC2_CTX;
-void MDC2_Init(MDC2_CTX *c);
-void MDC2_Update(MDC2_CTX *c, const unsigned char *data, unsigned long len);
-void MDC2_Final(unsigned char *md, MDC2_CTX *c);
+int MDC2_Init(MDC2_CTX *c);
+int MDC2_Update(MDC2_CTX *c, const unsigned char *data, unsigned long len);
+int MDC2_Final(unsigned char *md, MDC2_CTX *c);
unsigned char *MDC2(const unsigned char *d, unsigned long n,
unsigned char *md);
diff --git a/crypto/mdc2/mdc2dgst.c b/crypto/mdc2/mdc2dgst.c
index c630a24c2e..3a873d147a 100644
--- a/crypto/mdc2/mdc2dgst.c
+++ b/crypto/mdc2/mdc2dgst.c
@@ -75,15 +75,16 @@
*((c)++)=(unsigned char)(((l)>>24L)&0xff))
static void mdc2_body(MDC2_CTX *c, const unsigned char *in, unsigned int len);
-void MDC2_Init(MDC2_CTX *c)
+int MDC2_Init(MDC2_CTX *c)
{
c->num=0;
c->pad_type=1;
memset(&(c->h[0]),0x52,MDC2_BLOCK);
memset(&(c->hh[0]),0x25,MDC2_BLOCK);
+ return 1;
}
-void MDC2_Update(MDC2_CTX *c, const unsigned char *in, unsigned long len)
+int MDC2_Update(MDC2_CTX *c, const unsigned char *in, unsigned long len)
{
int i,j;
@@ -95,7 +96,7 @@ void MDC2_Update(MDC2_CTX *c, const unsigned char *in, unsigned long len)
/* partial block */
memcpy(&(c->data[i]),in,(int)len);
c->num+=(int)len;
- return;
+ return 1;
}
else
{
@@ -116,6 +117,7 @@ void MDC2_Update(MDC2_CTX *c, const unsigned char *in, unsigned long len)
memcpy(&(c->data[0]),&(in[i]),j);
c->num=j;
}
+ return 1;
}
static void mdc2_body(MDC2_CTX *c, const unsigned char *in, unsigned int len)
@@ -156,7 +158,7 @@ static void mdc2_body(MDC2_CTX *c, const unsigned char *in, unsigned int len)
}
}
-void MDC2_Final(unsigned char *md, MDC2_CTX *c)
+int MDC2_Final(unsigned char *md, MDC2_CTX *c)
{
int i,j;
@@ -171,6 +173,7 @@ void MDC2_Final(unsigned char *md, MDC2_CTX *c)
}
memcpy(md,(char *)c->h,MDC2_BLOCK);
memcpy(&(md[MDC2_BLOCK]),(char *)c->hh,MDC2_BLOCK);
+ return 1;
}
#undef TEST