Premaster secret handling fixes
[openssl.git] / crypto / sha / sha1test.c
index bddfff0c85aa1f4d4c2a48705e87174c95a72b88..6feb3964c7577f6083532d098fff25b45f213962 100644 (file)
@@ -60,6 +60,8 @@
 #include <string.h>
 #include <stdlib.h>
 
+#include "../e_os.h"
+
 #ifdef OPENSSL_NO_SHA
 int main(int argc, char *argv[])
 {
@@ -104,7 +106,7 @@ static char *pt(unsigned char *md);
 int main(int argc, char *argv[])
        {
        int i,err=0;
-       unsigned char **P,**R;
+       char **P,**R;
        static unsigned char buf[1000];
        char *p,*r;
        EVP_MD_CTX c;
@@ -116,12 +118,12 @@ int main(int argc, char *argv[])
 #endif
 
        EVP_MD_CTX_init(&c);
-       P=(unsigned char **)test;
-       R=(unsigned char **)ret;
+       P=test;
+       R=ret;
        i=1;
        while (*P != NULL)
                {
-               EVP_Digest(*P,(unsigned long)strlen((char *)*P),md,NULL,EVP_sha1());
+               EVP_Digest(*P,strlen((char *)*P),md,NULL,EVP_sha1(), NULL);
                p=pt(md);
                if (strcmp(p,(char *)*R) != 0)
                        {
@@ -140,10 +142,10 @@ int main(int argc, char *argv[])
 #ifdef CHARSET_EBCDIC
        ebcdic2ascii(buf, buf, 1000);
 #endif /*CHARSET_EBCDIC*/
-       EVP_DigestInit(&c,EVP_sha1());
+       EVP_DigestInit_ex(&c,EVP_sha1(), NULL);
        for (i=0; i<1000; i++)
                EVP_DigestUpdate(&c,buf,1000);
-       EVP_DigestFinal(&c,md,NULL);
+       EVP_DigestFinal_ex(&c,md,NULL);
        p=pt(md);
 
        r=bigret;
@@ -155,7 +157,11 @@ int main(int argc, char *argv[])
                }
        else
                printf("test 3 ok\n");
-       exit(err);
+
+#ifdef OPENSSL_SYS_NETWARE
+    if (err) printf("ERROR: %d\n", err);
+#endif
+       EXIT(err);
        EVP_MD_CTX_cleanup(&c);
        return(0);
        }