Fix from stable branch.
[openssl.git] / crypto / pkcs7 / verify.c
index 6973fca..b40f260 100644 (file)
@@ -56,6 +56,7 @@
  * [including the GNU Public Licence.]
  */
 #include <stdio.h>
+#include <string.h>
 #include <openssl/bio.h>
 #include <openssl/asn1.h>
 #include <openssl/x509.h>
@@ -84,10 +85,18 @@ char *argv[];
 
        bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
        bio_out=BIO_new_fp(stdout,BIO_NOCLOSE);
+#ifndef OPENSSL_NO_MD2
        EVP_add_digest(EVP_md2());
+#endif
+#ifndef OPENSSL_NO_MD5
        EVP_add_digest(EVP_md5());
+#endif
+#ifndef OPENSSL_NO_SHA1
        EVP_add_digest(EVP_sha1());
+#endif
+#ifndef OPENSSL_NO_MDC2
        EVP_add_digest(EVP_mdc2());
+#endif
 
        data=BIO_new(BIO_s_file());
 
@@ -170,10 +179,11 @@ char *argv[];
                {
                ASN1_UTCTIME *tm;
                char *str1,*str2;
+               int rc;
 
                si=sk_PKCS7_SIGNER_INFO_value(sk,i);
-               i=PKCS7_dataVerify(cert_store,&cert_ctx,p7bio,p7,si);
-               if (i <= 0)
+               rc=PKCS7_dataVerify(cert_store,&cert_ctx,p7bio,p7,si);
+               if (rc <= 0)
                        goto err;
                printf("signer info\n");
                if ((tm=get_signed_time(si)) != NULL)