Fix the tests to work with EBCDIC
[openssl.git] / test / mdc2test.c
index 4cf952c3f53f984754ebc957272d9205bdb98113..06456a87a18ca7c064372f72713e1f5d3982a0c5 100644 (file)
@@ -1,4 +1,3 @@
-/* crypto/mdc2/mdc2test.c */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -96,13 +95,13 @@ int main(int argc, char *argv[])
     unsigned char md[MDC2_DIGEST_LENGTH];
     int i;
     EVP_MD_CTX *c;
-    static char *text = "Now is the time for all ";
+    static char text[30] = "Now is the time for all ";
 
 # ifdef CHARSET_EBCDIC
     ebcdic2ascii(text, text, strlen(text));
 # endif
 
-    c = EVP_MD_CTX_create();
+    c = EVP_MD_CTX_new();
     EVP_DigestInit_ex(c, EVP_mdc2(), NULL);
     EVP_DigestUpdate(c, (unsigned char *)text, strlen(text));
     EVP_DigestFinal_ex(c, &(md[0]), NULL);
@@ -135,11 +134,7 @@ int main(int argc, char *argv[])
     } else
         printf("pad2 - ok\n");
 
-    EVP_MD_CTX_destroy(c);
-# ifdef OPENSSL_SYS_NETWARE
-    if (ret)
-        printf("ERROR: %d\n", ret);
-# endif
+    EVP_MD_CTX_free(c);
     EXIT(ret);
 }
 #endif