summaryrefslogtreecommitdiffstats
path: root/crypto/mdc2
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2001-07-30 23:57:25 +0000
committerBen Laurie <ben@openssl.org>2001-07-30 23:57:25 +0000
commitdbad169019598981174ff46c7a9bf58373b0e53a (patch)
treece8ca1188d5614648f24b03967785543f1edc8f5 /crypto/mdc2
parent3ba5d1cf2eb6ef28ac5f6d9f3d28020d00c5be50 (diff)
Really add the EVP and all of the DES changes.
Diffstat (limited to 'crypto/mdc2')
-rw-r--r--crypto/mdc2/Makefile.ssl3
-rw-r--r--crypto/mdc2/mdc2dgst.c8
-rw-r--r--crypto/mdc2/mdc2test.c6
3 files changed, 10 insertions, 7 deletions
diff --git a/crypto/mdc2/Makefile.ssl b/crypto/mdc2/Makefile.ssl
index 58bdb0dd9c..6728c71000 100644
--- a/crypto/mdc2/Makefile.ssl
+++ b/crypto/mdc2/Makefile.ssl
@@ -86,7 +86,6 @@ mdc2_one.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
mdc2_one.o: ../../include/openssl/mdc2.h ../../include/openssl/opensslconf.h
mdc2_one.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
mdc2_one.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
-mdc2_one.o: ../cryptlib.h mdc2_one.c
+mdc2_one.o: ../cryptlib.h
mdc2dgst.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h
mdc2dgst.o: ../../include/openssl/mdc2.h ../../include/openssl/opensslconf.h
-mdc2dgst.o: mdc2dgst.c
diff --git a/crypto/mdc2/mdc2dgst.c b/crypto/mdc2/mdc2dgst.c
index bf67c03ffc..88dd4e250b 100644
--- a/crypto/mdc2/mdc2dgst.c
+++ b/crypto/mdc2/mdc2dgst.c
@@ -137,12 +137,12 @@ static void mdc2_body(MDC2_CTX *c, const unsigned char *in, unsigned int len)
c->hh[0]=(c->hh[0]&0x9f)|0x20;
des_set_odd_parity(&c->h);
- des_set_key_unchecked(&c->h,k);
- des_encrypt1(d,k,1);
+ des_set_key_unchecked(&c->h,&k);
+ des_encrypt1(d,&k,1);
des_set_odd_parity(&c->hh);
- des_set_key_unchecked(&c->hh,k);
- des_encrypt1(dd,k,1);
+ des_set_key_unchecked(&c->hh,&k);
+ des_encrypt1(dd,&k,1);
ttin0=tin0^dd[0];
ttin1=tin1^dd[1];
diff --git a/crypto/mdc2/mdc2test.c b/crypto/mdc2/mdc2test.c
index 9507fed7db..acb517e0cb 100644
--- a/crypto/mdc2/mdc2test.c
+++ b/crypto/mdc2/mdc2test.c
@@ -72,6 +72,7 @@ int main(int argc, char *argv[])
}
#else
#include <openssl/evp.h>
+#include <openssl/mdc2.h>
#ifdef CHARSET_EBCDIC
#include <openssl/ebcdic.h>
@@ -99,6 +100,7 @@ int main(int argc, char *argv[])
ebcdic2ascii(text,text,strlen(text));
#endif
+ EVP_MD_CTX_init(&c);
EVP_DigestInit(&c,EVP_mdc2());
EVP_DigestUpdate(&c,(unsigned char *)text,strlen(text));
EVP_DigestFinal(&c,&(md[0]),NULL);
@@ -117,7 +119,8 @@ int main(int argc, char *argv[])
printf("pad1 - ok\n");
EVP_DigestInit(&c,EVP_mdc2());
- c.md.mdc2.pad_type=2;
+ /* FIXME: use a ctl function? */
+ ((MDC2_CTX *)c.md_data)->pad_type=2;
EVP_DigestUpdate(&c,(unsigned char *)text,strlen(text));
EVP_DigestFinal(&c,&(md[0]),NULL);
@@ -134,6 +137,7 @@ int main(int argc, char *argv[])
else
printf("pad2 - ok\n");
+ EVP_MD_CTX_cleanup(&c);
exit(ret);
return(ret);
}