summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/md2/md2test.c
diff options
context:
space:
mode:
authorbeck <>2002-05-15 02:29:21 +0000
committerbeck <>2002-05-15 02:29:21 +0000
commitb64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9 (patch)
treefa27cf82a1250b64ed3bf5f4a18c7354d470bbcc /src/lib/libcrypto/md2/md2test.c
parente471e1ea98d673597b182ea85f29e30c97cd08b5 (diff)
downloadopenbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.gz
openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.bz2
openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.zip
OpenSSL 0.9.7 stable 2002 05 08 merge
Diffstat (limited to 'src/lib/libcrypto/md2/md2test.c')
-rw-r--r--src/lib/libcrypto/md2/md2test.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/libcrypto/md2/md2test.c b/src/lib/libcrypto/md2/md2test.c
index e3f4fb4c34..7d3664faf5 100644
--- a/src/lib/libcrypto/md2/md2test.c
+++ b/src/lib/libcrypto/md2/md2test.c
@@ -59,15 +59,16 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h> 60#include <stdlib.h>
61#include <string.h> 61#include <string.h>
62#include <openssl/md2.h>
62 63
63#ifdef NO_MD2 64#ifdef OPENSSL_NO_MD2
64int main(int argc, char *argv[]) 65int main(int argc, char *argv[])
65{ 66{
66 printf("No MD2 support\n"); 67 printf("No MD2 support\n");
67 return(0); 68 return(0);
68} 69}
69#else 70#else
70#include <openssl/md2.h> 71#include <openssl/evp.h>
71 72
72#ifdef CHARSET_EBCDIC 73#ifdef CHARSET_EBCDIC
73#include <openssl/ebcdic.h> 74#include <openssl/ebcdic.h>
@@ -100,13 +101,15 @@ int main(int argc, char *argv[])
100 int i,err=0; 101 int i,err=0;
101 char **P,**R; 102 char **P,**R;
102 char *p; 103 char *p;
104 unsigned char md[MD2_DIGEST_LENGTH];
103 105
104 P=test; 106 P=test;
105 R=ret; 107 R=ret;
106 i=1; 108 i=1;
107 while (*P != NULL) 109 while (*P != NULL)
108 { 110 {
109 p=pt(MD2((unsigned char *)*P,(unsigned long)strlen(*P),NULL)); 111 EVP_Digest((unsigned char *)*P,(unsigned long)strlen(*P),md,NULL,EVP_md2(), NULL);
112 p=pt(md);
110 if (strcmp(p,*R) != 0) 113 if (strcmp(p,*R) != 0)
111 { 114 {
112 printf("error calculating MD2 on '%s'\n",*P); 115 printf("error calculating MD2 on '%s'\n",*P);