X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fhmac%2Fhmactest.c;h=96d3beb8e6180e8f5ee3ee423767beb3bb2f8996;hb=dbad169019598981174ff46c7a9bf58373b0e53a;hp=5938e375dcbf9d732179e59b60eeaa62fefeb42c;hpb=7dfb0b774e6592dcbfe47015168a0ac8b44e2a17;p=oweals%2Fopenssl.git diff --git a/crypto/hmac/hmactest.c b/crypto/hmac/hmactest.c index 5938e375dc..96d3beb8e6 100644 --- a/crypto/hmac/hmactest.c +++ b/crypto/hmac/hmactest.c @@ -59,9 +59,22 @@ #include #include #include -#include "hmac.h" -struct test_st +#ifdef OPENSSL_NO_HMAC +int main(int argc, char *argv[]) +{ + printf("No HMAC support\n"); + return(0); +} +#else +#include +#include + +#ifdef CHARSET_EBCDIC +#include +#endif + +static struct test_st { unsigned char key[16]; int key_len; @@ -102,19 +115,19 @@ struct test_st }; -#ifndef NOPROTO static char *pt(unsigned char *md); -#else -static char *pt(); -#endif - -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int i,err=0; char *p; +#ifdef CHARSET_EBCDIC + ebcdic2ascii(test[0].data, test[0].data, test[0].data_len); + ebcdic2ascii(test[1].data, test[1].data, test[1].data_len); + ebcdic2ascii(test[2].key, test[2].key, test[2].key_len); + ebcdic2ascii(test[2].data, test[2].data, test[2].data_len); +#endif + for (i=0; i<4; i++) { p=pt(HMAC(EVP_md5(), @@ -135,8 +148,7 @@ char *argv[]; return(0); } -static char *pt(md) -unsigned char *md; +static char *pt(unsigned char *md) { int i; static char buf[80]; @@ -145,3 +157,4 @@ unsigned char *md; sprintf(&(buf[i*2]),"%02x",md[i]); return(buf); } +#endif