projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make samples compile.
[openssl.git]
/
crypto
/
pkcs7
/
verify.c
diff --git
a/crypto/pkcs7/verify.c
b/crypto/pkcs7/verify.c
index 38b89b508072c6969f9a5a5918668db7a7f4b513..32d9783e4515c92b50dbaffa7cca11b3c41906cd 100644
(file)
--- a/
crypto/pkcs7/verify.c
+++ b/
crypto/pkcs7/verify.c
@@
-56,33
+56,31
@@
* [including the GNU Public Licence.]
*/
#include <stdio.h>
* [including the GNU Public Licence.]
*/
#include <stdio.h>
-#include "asn1.h"
-#include "bio.h"
-#include "x509.h"
-#include "pem.h"
+#include <openssl/bio.h>
+#include <openssl/asn1.h>
+#include <openssl/x509.h>
+#include <openssl/pem.h>
+#include <openssl/err.h>
+#include "example.h"
int verify_callback(int ok, X509_STORE_CTX *ctx);
BIO *bio_err=NULL;
BIO *bio_out=NULL;
int verify_callback(int ok, X509_STORE_CTX *ctx);
BIO *bio_err=NULL;
BIO *bio_out=NULL;
-main(argc,argv)
+
int
main(argc,argv)
int argc;
char *argv[];
{
int argc;
char *argv[];
{
- X509 *x509,*x;
PKCS7 *p7;
PKCS7 *p7;
- PKCS7_SIGNED *s;
PKCS7_SIGNER_INFO *si;
PKCS7_SIGNER_INFO *si;
- PKCS7_ISSUER_AND_SERIAL *ias;
X509_STORE_CTX cert_ctx;
X509_STORE *cert_store=NULL;
X509_STORE_CTX cert_ctx;
X509_STORE *cert_store=NULL;
- X509_LOOKUP *lookup=NULL;
BIO *data,*detached=NULL,*p7bio=NULL;
char buf[1024*4];
BIO *data,*detached=NULL,*p7bio=NULL;
char buf[1024*4];
-
unsigned char *p,
*pp;
- int i,
j,
printit=0;
- STACK *sk;
+
char
*pp;
+ int i,printit=0;
+ STACK
_OF(PKCS7_SIGNER_INFO)
*sk;
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
bio_out=BIO_new_fp(stdout,BIO_NOCLOSE);
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
bio_out=BIO_new_fp(stdout,BIO_NOCLOSE);
@@
-92,7
+90,7
@@
char *argv[];
EVP_add_digest(EVP_mdc2());
data=BIO_new(BIO_s_file());
EVP_add_digest(EVP_mdc2());
data=BIO_new(BIO_s_file());
-again:
+
pp=NULL;
while (argc > 1)
{
pp=NULL;
while (argc > 1)
{
@@
-168,12
+166,12
@@
again:
}
/* Ok, first we need to, for each subject entry, see if we can verify */
}
/* Ok, first we need to, for each subject entry, see if we can verify */
- for (i=0; i<sk_num(sk); i++)
+ for (i=0; i<sk_
PKCS7_SIGNER_INFO_
num(sk); i++)
{
ASN1_UTCTIME *tm;
char *str1,*str2;
{
ASN1_UTCTIME *tm;
char *str1,*str2;
- si=
(PKCS7_SIGNER_INFO *)sk
_value(sk,i);
+ si=
sk_PKCS7_SIGNER_INFO
_value(sk,i);
i=PKCS7_dataVerify(cert_store,&cert_ctx,p7bio,p7,si);
if (i <= 0)
goto err;
i=PKCS7_dataVerify(cert_store,&cert_ctx,p7bio,p7,si);
if (i <= 0)
goto err;
@@
-204,9
+202,7
@@
err:
}
/* should be X509 * but we can just have them as char *. */
}
/* should be X509 * but we can just have them as char *. */
-int verify_callback(ok, ctx)
-int ok;
-X509_STORE_CTX *ctx;
+int verify_callback(int ok, X509_STORE_CTX *ctx)
{
char buf[256];
X509 *err_cert;
{
char buf[256];
X509 *err_cert;