[aes|cmll]t4-sparcv9.pl: addendum to previous sparcv9_modes.pl commit.
[openssl.git] / crypto / hmac / hmactest.c
index 96d3beb8e6180e8f5ee3ee423767beb3bb2f8996..1b906b81afb77b0d21899e932689c2b599298a0a 100644 (file)
@@ -60,6 +60,8 @@
 #include <string.h>
 #include <stdlib.h>
 
+#include "../e_os.h"
+
 #ifdef OPENSSL_NO_HMAC
 int main(int argc, char *argv[])
 {
@@ -68,12 +70,15 @@ int main(int argc, char *argv[])
 }
 #else
 #include <openssl/hmac.h>
+#ifndef OPENSSL_NO_MD5
 #include <openssl/md5.h>
+#endif
 
 #ifdef CHARSET_EBCDIC
 #include <openssl/ebcdic.h>
 #endif
 
+#ifndef OPENSSL_NO_MD5
 static struct test_st
        {
        unsigned char key[16];
@@ -113,13 +118,20 @@ static struct test_st
                (unsigned char *)"56be34521d144c88dbb8c733f0e8b3f6",
        },
        };
-
+#endif
 
 static char *pt(unsigned char *md);
 int main(int argc, char *argv[])
        {
-       int i,err=0;
+#ifndef OPENSSL_NO_MD5
+       int i;
        char *p;
+#endif
+       int err=0;
+
+#ifdef OPENSSL_NO_MD5
+       printf("test skipped: MD5 disabled\n");
+#else
 
 #ifdef CHARSET_EBCDIC
        ebcdic2ascii(test[0].data, test[0].data, test[0].data_len);
@@ -144,10 +156,12 @@ int main(int argc, char *argv[])
                else
                        printf("test %d ok\n",i);
                }
-       exit(err);
+#endif /* OPENSSL_NO_MD5 */
+       EXIT(err);
        return(0);
        }
 
+#ifndef OPENSSL_NO_MD5
 static char *pt(unsigned char *md)
        {
        int i;
@@ -158,3 +172,4 @@ static char *pt(unsigned char *md)
        return(buf);
        }
 #endif
+#endif