Adjust all accesses to EVP_MD_CTX to use accessor functions.
[openssl.git] / test / sha1test.c
index cc3633dc6899ecdbb20fb0fb1d6ad2cda9e46ab7..6b8ad42141e56791f0fed63ffa51523742e594b2 100644 (file)
@@ -88,7 +88,7 @@ int main(int argc, char *argv[])
     char **P, **R;
     static unsigned char buf[1000];
     char *p, *r;
-    EVP_MD_CTX c;
+    EVP_MD_CTX *c;
     unsigned char md[SHA_DIGEST_LENGTH];
 
 #ifdef CHARSET_EBCDIC
@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
     ebcdic2ascii(test[1], test[1], strlen(test[1]));
 #endif
 
-    EVP_MD_CTX_init(&c);
+    c = EVP_MD_CTX_create();
     P = test;
     R = ret;
     i = 1;
@@ -118,10 +118,10 @@ int main(int argc, char *argv[])
 #ifdef CHARSET_EBCDIC
     ebcdic2ascii(buf, buf, 1000);
 #endif                         /* CHARSET_EBCDIC */
-    EVP_DigestInit_ex(&c, EVP_sha1(), NULL);
+    EVP_DigestInit_ex(c, EVP_sha1(), NULL);
     for (i = 0; i < 1000; i++)
-        EVP_DigestUpdate(&c, buf, 1000);
-    EVP_DigestFinal_ex(&c, md, NULL);
+        EVP_DigestUpdate(c, buf, 1000);
+    EVP_DigestFinal_ex(c, md, NULL);
     p = pt(md);
 
     r = bigret;
@@ -137,7 +137,7 @@ int main(int argc, char *argv[])
         printf("ERROR: %d\n", err);
 #endif
     EXIT(err);
-    EVP_MD_CTX_cleanup(&c);
+    EVP_MD_CTX_destroy(c);
     return (0);
 }