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/hmac/hmactest.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/hmac/hmactest.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/src/lib/libcrypto/hmac/hmactest.c b/src/lib/libcrypto/hmac/hmactest.c index 5938e375dc..9a67dff36a 100644 --- a/src/lib/libcrypto/hmac/hmactest.c +++ b/src/lib/libcrypto/hmac/hmactest.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 "hmac.h" | 62 | |
| 63 | #ifdef NO_HMAC | ||
| 64 | int main(int argc, char *argv[]) | ||
| 65 | { | ||
| 66 | printf("No HMAC support\n"); | ||
| 67 | return(0); | ||
| 68 | } | ||
| 69 | #else | ||
| 70 | #include <openssl/hmac.h> | ||
| 71 | |||
| 72 | #ifdef CHARSET_EBCDIC | ||
| 73 | #include <openssl/ebcdic.h> | ||
| 74 | #endif | ||
| 63 | 75 | ||
| 64 | struct test_st | 76 | struct test_st |
| 65 | { | 77 | { |
| @@ -102,19 +114,19 @@ struct test_st | |||
| 102 | }; | 114 | }; |
| 103 | 115 | ||
| 104 | 116 | ||
| 105 | #ifndef NOPROTO | ||
| 106 | static char *pt(unsigned char *md); | 117 | static char *pt(unsigned char *md); |
| 107 | #else | 118 | int main(int argc, char *argv[]) |
| 108 | static char *pt(); | ||
| 109 | #endif | ||
| 110 | |||
| 111 | int main(argc,argv) | ||
| 112 | int argc; | ||
| 113 | char *argv[]; | ||
| 114 | { | 119 | { |
| 115 | int i,err=0; | 120 | int i,err=0; |
| 116 | char *p; | 121 | char *p; |
| 117 | 122 | ||
| 123 | #ifdef CHARSET_EBCDIC | ||
| 124 | ebcdic2ascii(test[0].data, test[0].data, test[0].data_len); | ||
| 125 | ebcdic2ascii(test[1].data, test[1].data, test[1].data_len); | ||
| 126 | ebcdic2ascii(test[2].key, test[2].key, test[2].key_len); | ||
| 127 | ebcdic2ascii(test[2].data, test[2].data, test[2].data_len); | ||
| 128 | #endif | ||
| 129 | |||
| 118 | for (i=0; i<4; i++) | 130 | for (i=0; i<4; i++) |
| 119 | { | 131 | { |
| 120 | p=pt(HMAC(EVP_md5(), | 132 | p=pt(HMAC(EVP_md5(), |
| @@ -135,8 +147,7 @@ char *argv[]; | |||
| 135 | return(0); | 147 | return(0); |
| 136 | } | 148 | } |
| 137 | 149 | ||
| 138 | static char *pt(md) | 150 | static char *pt(unsigned char *md) |
| 139 | unsigned char *md; | ||
| 140 | { | 151 | { |
| 141 | int i; | 152 | int i; |
| 142 | static char buf[80]; | 153 | static char buf[80]; |
| @@ -145,3 +156,4 @@ unsigned char *md; | |||
| 145 | sprintf(&(buf[i*2]),"%02x",md[i]); | 156 | sprintf(&(buf[i*2]),"%02x",md[i]); |
| 146 | return(buf); | 157 | return(buf); |
| 147 | } | 158 | } |
| 159 | #endif | ||
