diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/md2/md2test.c | 9 |
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 |
| 64 | int main(int argc, char *argv[]) | 65 | int 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); |
