diff options
author | markus <> | 2003-05-11 21:36:59 +0000 |
---|---|---|
committer | markus <> | 2003-05-11 21:36:59 +0000 |
commit | 9cea7b85baecb1a02a3ea617de73d9693a9792eb (patch) | |
tree | b0ca83a03e35572831c5818cd2011868d462a5d1 /src/lib/libcrypto/hmac | |
parent | f8f1d7fabf136ce9810602509c477d2c42bf6d1c (diff) | |
download | openbsd-9cea7b85baecb1a02a3ea617de73d9693a9792eb.tar.gz openbsd-9cea7b85baecb1a02a3ea617de73d9693a9792eb.tar.bz2 openbsd-9cea7b85baecb1a02a3ea617de73d9693a9792eb.zip |
import 0.9.7b (without idea and rc5)
Diffstat (limited to 'src/lib/libcrypto/hmac')
-rw-r--r-- | src/lib/libcrypto/hmac/hmactest.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/lib/libcrypto/hmac/hmactest.c b/src/lib/libcrypto/hmac/hmactest.c index 96d3beb8e6..1b906b81af 100644 --- a/src/lib/libcrypto/hmac/hmactest.c +++ b/src/lib/libcrypto/hmac/hmactest.c | |||
@@ -60,6 +60,8 @@ | |||
60 | #include <string.h> | 60 | #include <string.h> |
61 | #include <stdlib.h> | 61 | #include <stdlib.h> |
62 | 62 | ||
63 | #include "../e_os.h" | ||
64 | |||
63 | #ifdef OPENSSL_NO_HMAC | 65 | #ifdef OPENSSL_NO_HMAC |
64 | int main(int argc, char *argv[]) | 66 | int main(int argc, char *argv[]) |
65 | { | 67 | { |
@@ -68,12 +70,15 @@ int main(int argc, char *argv[]) | |||
68 | } | 70 | } |
69 | #else | 71 | #else |
70 | #include <openssl/hmac.h> | 72 | #include <openssl/hmac.h> |
73 | #ifndef OPENSSL_NO_MD5 | ||
71 | #include <openssl/md5.h> | 74 | #include <openssl/md5.h> |
75 | #endif | ||
72 | 76 | ||
73 | #ifdef CHARSET_EBCDIC | 77 | #ifdef CHARSET_EBCDIC |
74 | #include <openssl/ebcdic.h> | 78 | #include <openssl/ebcdic.h> |
75 | #endif | 79 | #endif |
76 | 80 | ||
81 | #ifndef OPENSSL_NO_MD5 | ||
77 | static struct test_st | 82 | static struct test_st |
78 | { | 83 | { |
79 | unsigned char key[16]; | 84 | unsigned char key[16]; |
@@ -113,13 +118,20 @@ static struct test_st | |||
113 | (unsigned char *)"56be34521d144c88dbb8c733f0e8b3f6", | 118 | (unsigned char *)"56be34521d144c88dbb8c733f0e8b3f6", |
114 | }, | 119 | }, |
115 | }; | 120 | }; |
116 | 121 | #endif | |
117 | 122 | ||
118 | static char *pt(unsigned char *md); | 123 | static char *pt(unsigned char *md); |
119 | int main(int argc, char *argv[]) | 124 | int main(int argc, char *argv[]) |
120 | { | 125 | { |
121 | int i,err=0; | 126 | #ifndef OPENSSL_NO_MD5 |
127 | int i; | ||
122 | char *p; | 128 | char *p; |
129 | #endif | ||
130 | int err=0; | ||
131 | |||
132 | #ifdef OPENSSL_NO_MD5 | ||
133 | printf("test skipped: MD5 disabled\n"); | ||
134 | #else | ||
123 | 135 | ||
124 | #ifdef CHARSET_EBCDIC | 136 | #ifdef CHARSET_EBCDIC |
125 | ebcdic2ascii(test[0].data, test[0].data, test[0].data_len); | 137 | ebcdic2ascii(test[0].data, test[0].data, test[0].data_len); |
@@ -144,10 +156,12 @@ int main(int argc, char *argv[]) | |||
144 | else | 156 | else |
145 | printf("test %d ok\n",i); | 157 | printf("test %d ok\n",i); |
146 | } | 158 | } |
147 | exit(err); | 159 | #endif /* OPENSSL_NO_MD5 */ |
160 | EXIT(err); | ||
148 | return(0); | 161 | return(0); |
149 | } | 162 | } |
150 | 163 | ||
164 | #ifndef OPENSSL_NO_MD5 | ||
151 | static char *pt(unsigned char *md) | 165 | static char *pt(unsigned char *md) |
152 | { | 166 | { |
153 | int i; | 167 | int i; |
@@ -158,3 +172,4 @@ static char *pt(unsigned char *md) | |||
158 | return(buf); | 172 | return(buf); |
159 | } | 173 | } |
160 | #endif | 174 | #endif |
175 | #endif | ||