Really add the EVP and all of the DES changes.
[oweals/openssl.git] / crypto / hmac / hmactest.c
index 0a3db6852c15bf5135b9b2721147b125fe3240b7..96d3beb8e6180e8f5ee3ee423767beb3bb2f8996 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+
+#ifdef OPENSSL_NO_HMAC
+int main(int argc, char *argv[])
+{
+    printf("No HMAC support\n");
+    return(0);
+}
+#else
 #include <openssl/hmac.h>
+#include <openssl/md5.h>
 
-struct test_st
+#ifdef CHARSET_EBCDIC
+#include <openssl/ebcdic.h>
+#endif
+
+static struct test_st
        {
        unsigned char key[16];
        int key_len;
@@ -108,6 +121,13 @@ 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(),
@@ -137,3 +157,4 @@ static char *pt(unsigned char *md)
                sprintf(&(buf[i*2]),"%02x",md[i]);
        return(buf);
        }
+#endif