Add new function X509_STORE_set_verify_cb and use it in apps
authorDr. Stephen Henson <steve@openssl.org>
Sun, 18 Oct 2009 14:42:27 +0000 (14:42 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 18 Oct 2009 14:42:27 +0000 (14:42 +0000)
apps/cms.c
apps/smime.c
apps/ts.c
apps/verify.c
apps/x509.c
crypto/x509/x509_lu.c
crypto/x509/x509_vfy.h

index 3adcd78a9d1d1aec7365d269f33ff161a7437d8d..d29a8849022c970793378b6313edccf2d72f945f 100644 (file)
@@ -880,7 +880,7 @@ int MAIN(int argc, char **argv)
                {
                if (!(store = setup_verify(bio_err, CAfile, CApath)))
                        goto end;
-               X509_STORE_set_verify_cb_func(store, cms_cb);
+               X509_STORE_set_verify_cb(store, cms_cb);
                if (vpm)
                        X509_STORE_set1_param(store, vpm);
                }
index 67df0667b675784f31c1161b02294a810161c803..c583f8a0e16205bbf5b2bf56560aaafacfe0477e 100644 (file)
@@ -671,7 +671,7 @@ int MAIN(int argc, char **argv)
                {
                if (!(store = setup_verify(bio_err, CAfile, CApath)))
                        goto end;
-               X509_STORE_set_verify_cb_func(store, smime_cb);
+               X509_STORE_set_verify_cb(store, smime_cb);
                if (vpm)
                        X509_STORE_set1_param(store, vpm);
                }
index bedb602fd5d5648aec544ffc3b5d2e29cff9ba92..5fa9f7fda07d91d2e547ffce1007c1b5f9332121 100644 (file)
--- a/apps/ts.c
+++ b/apps/ts.c
@@ -1083,7 +1083,7 @@ static X509_STORE *create_cert_store(char *ca_path, char *ca_file)
        cert_ctx = X509_STORE_new();
 
        /* Setting the callback for certificate chain verification. */
-       X509_STORE_set_verify_cb_func(cert_ctx, verify_cb);
+       X509_STORE_set_verify_cb(cert_ctx, verify_cb);
 
        /* Adding a trusted certificate directory source. */
        if (ca_path)
index 838ac46827edd714679783c3c3f16eb528055d12..96fcfb429d4185915f8d06747b8f888243a65f06 100644 (file)
@@ -93,7 +93,7 @@ int MAIN(int argc, char **argv)
 
        cert_ctx=X509_STORE_new();
        if (cert_ctx == NULL) goto end;
-       X509_STORE_set_verify_cb_func(cert_ctx,cb);
+       X509_STORE_set_verify_cb(cert_ctx,cb);
 
        ERR_load_crypto_strings();
 
index 72d104bf09f44e186f1cd51e95bee45a90b15ada..0be3414d34884e04d28939f986e9c3210ee7034a 100644 (file)
@@ -225,7 +225,7 @@ int MAIN(int argc, char **argv)
 
        ctx=X509_STORE_new();
        if (ctx == NULL) goto end;
-       X509_STORE_set_verify_cb_func(ctx,callb);
+       X509_STORE_set_verify_cb(ctx,callb);
 
        argc--;
        argv++;
index e29c35c861f1050f86f5688f96e36f066667f8dd..fb7d23bbd0ade78ed981a8fd0564da9bad62422d 100644 (file)
@@ -695,5 +695,11 @@ int X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *param)
        return X509_VERIFY_PARAM_set1(ctx->param, param);
        }
 
+void X509_STORE_set_verify_cb(X509_STORE *ctx,
+                                 int (*verify_cb)(int, X509_STORE_CTX *))
+       {
+       ctx->verify_cb = verify_cb;
+       }
+
 IMPLEMENT_STACK_OF(X509_LOOKUP)
 IMPLEMENT_STACK_OF(X509_OBJECT)
index 4e73806adc3c324b1556fe01f3368c9ee9cdb9b3..acb713a6e510045402a57e1eb4c5e8a8a0f3dfb5 100644 (file)
@@ -419,6 +419,9 @@ int X509_STORE_set_purpose(X509_STORE *ctx, int purpose);
 int X509_STORE_set_trust(X509_STORE *ctx, int trust);
 int X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *pm);
 
+void X509_STORE_set_verify_cb(X509_STORE *ctx,
+                                 int (*verify_cb)(int, X509_STORE_CTX *));
+
 X509_STORE_CTX *X509_STORE_CTX_new(void);
 
 int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);