diff options
| author | beck <> | 1999-09-29 04:37:45 +0000 |
|---|---|---|
| committer | beck <> | 1999-09-29 04:37:45 +0000 |
| commit | de8f24ea083384bb66b32ec105dc4743c5663cdf (patch) | |
| tree | 1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/ripemd/rmdtest.c | |
| parent | cb929d29896bcb87c2a97417fbd03e50078fc178 (diff) | |
| download | openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2 openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip | |
OpenSSL 0.9.4 merge
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/ripemd/rmdtest.c | 31 |
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 | ||
| 64 | int 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 | ||
| 64 | char *test[]={ | 76 | char *test[]={ |
| 65 | "", | 77 | "", |
| @@ -84,15 +96,8 @@ char *ret[]={ | |||
| 84 | "9b752e45573d4b39f4dbd3323cab82bf63326bfb", | 96 | "9b752e45573d4b39f4dbd3323cab82bf63326bfb", |
| 85 | }; | 97 | }; |
| 86 | 98 | ||
| 87 | #ifndef NOPROTO | ||
| 88 | static char *pt(unsigned char *md); | 99 | static char *pt(unsigned char *md); |
| 89 | #else | 100 | int main(int argc, char *argv[]) |
| 90 | static char *pt(); | ||
| 91 | #endif | ||
| 92 | |||
| 93 | int main(argc,argv) | ||
| 94 | int argc; | ||
| 95 | char *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 | ||
| 123 | static char *pt(md) | 131 | static char *pt(unsigned char *md) |
| 124 | unsigned 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 | |
