summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ripemd/rmdtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ripemd/rmdtest.c')
-rw-r--r--src/lib/libcrypto/ripemd/rmdtest.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/lib/libcrypto/ripemd/rmdtest.c b/src/lib/libcrypto/ripemd/rmdtest.c
index 6a0297f975..5e93d4627c 100644
--- a/src/lib/libcrypto/ripemd/rmdtest.c
+++ b/src/lib/libcrypto/ripemd/rmdtest.c
@@ -59,7 +59,19 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61#include <stdlib.h> 61#include <stdlib.h>
62#include "ripemd.h" 62
63#ifdef NO_RIPEMD
64int main(int argc, char *argv[])
65{
66 printf("No ripemd support\n");
67 return(0);
68}
69#else
70#include <openssl/ripemd.h>
71
72#ifdef CHARSET_EBCDIC
73#include <openssl/ebcdic.h>
74#endif
63 75
64char *test[]={ 76char *test[]={
65 "", 77 "",
@@ -84,15 +96,8 @@ char *ret[]={
84 "9b752e45573d4b39f4dbd3323cab82bf63326bfb", 96 "9b752e45573d4b39f4dbd3323cab82bf63326bfb",
85 }; 97 };
86 98
87#ifndef NOPROTO
88static char *pt(unsigned char *md); 99static char *pt(unsigned char *md);
89#else 100int main(int argc, char *argv[])
90static char *pt();
91#endif
92
93int main(argc,argv)
94int argc;
95char *argv[];
96 { 101 {
97 int i,err=0; 102 int i,err=0;
98 unsigned char **P,**R; 103 unsigned char **P,**R;
@@ -103,6 +108,9 @@ char *argv[];
103 i=1; 108 i=1;
104 while (*P != NULL) 109 while (*P != NULL)
105 { 110 {
111#ifdef CHARSET_EBCDIC
112 ebcdic2ascii((char *)*P, (char *)*P, strlen((char *)*P));
113#endif
106 p=pt(RIPEMD160(&(P[0][0]),(unsigned long)strlen((char *)*P),NULL)); 114 p=pt(RIPEMD160(&(P[0][0]),(unsigned long)strlen((char *)*P),NULL));
107 if (strcmp(p,(char *)*R) != 0) 115 if (strcmp(p,(char *)*R) != 0)
108 { 116 {
@@ -120,8 +128,7 @@ char *argv[];
120 return(0); 128 return(0);
121 } 129 }
122 130
123static char *pt(md) 131static char *pt(unsigned char *md)
124unsigned char *md;
125 { 132 {
126 int i; 133 int i;
127 static char buf[80]; 134 static char buf[80];
@@ -130,4 +137,4 @@ unsigned char *md;
130 sprintf(&(buf[i*2]),"%02x",md[i]); 137 sprintf(&(buf[i*2]),"%02x",md[i]);
131 return(buf); 138 return(buf);
132 } 139 }
133 140#endif