summaryrefslogtreecommitdiffstats
path: root/crypto/mdc2
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2001-06-19 22:30:40 +0000
committerDr. Stephen Henson <steve@openssl.org>2001-06-19 22:30:40 +0000
commit323f289c480b0a8eb15ed3be2befbcc0f86e8904 (patch)
treea8f18dde28ce3c77b7bff50c2b45a44c556dfed4 /crypto/mdc2
parenta45e4a5537e009761652db0d9aa1ef28b1ce8937 (diff)
Change all calls to low level digest routines in the library and
applications to use EVP. Add missing calls to HMAC_cleanup() and don't assume HMAC_CTX can be copied using memcpy(). Note: this is almost identical to the patch submitted to openssl-dev by Verdon Walker <VWalker@novell.com> except some redundant EVP_add_digest_()/EVP_cleanup() calls were removed and some changes made to avoid compiler warnings.
Diffstat (limited to 'crypto/mdc2')
-rw-r--r--crypto/mdc2/mdc2test.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/crypto/mdc2/mdc2test.c b/crypto/mdc2/mdc2test.c
index 6a50e9debe..9507fed7db 100644
--- a/crypto/mdc2/mdc2test.c
+++ b/crypto/mdc2/mdc2test.c
@@ -71,7 +71,7 @@ int main(int argc, char *argv[])
return(0);
}
#else
-#include <openssl/mdc2.h>
+#include <openssl/evp.h>
#ifdef CHARSET_EBCDIC
#include <openssl/ebcdic.h>
@@ -92,16 +92,16 @@ int main(int argc, char *argv[])
int ret=0;
unsigned char md[MDC2_DIGEST_LENGTH];
int i;
- MDC2_CTX c;
+ EVP_MD_CTX c;
static char *text="Now is the time for all ";
#ifdef CHARSET_EBCDIC
ebcdic2ascii(text,text,strlen(text));
#endif
- MDC2_Init(&c);
- MDC2_Update(&c,(unsigned char *)text,strlen(text));
- MDC2_Final(&(md[0]),&c);
+ EVP_DigestInit(&c,EVP_mdc2());
+ EVP_DigestUpdate(&c,(unsigned char *)text,strlen(text));
+ EVP_DigestFinal(&c,&(md[0]),NULL);
if (memcmp(md,pad1,MDC2_DIGEST_LENGTH) != 0)
{
@@ -116,10 +116,10 @@ int main(int argc, char *argv[])
else
printf("pad1 - ok\n");
- MDC2_Init(&c);
- c.pad_type=2;
- MDC2_Update(&c,(unsigned char *)text,strlen(text));
- MDC2_Final(&(md[0]),&c);
+ EVP_DigestInit(&c,EVP_mdc2());
+ c.md.mdc2.pad_type=2;
+ EVP_DigestUpdate(&c,(unsigned char *)text,strlen(text));
+ EVP_DigestFinal(&c,&(md[0]),NULL);
if (memcmp(md,pad2,MDC2_DIGEST_LENGTH) != 0)
{