From 4e35e83d561145a11ec839b1e21946f1c1cc69b3 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Tue, 19 Apr 2016 15:22:33 +0900 Subject: Remove code duplication Remove duplicated ctx->verify_cb = store->verify_cb; in X509_STORE_CTX_init(). Remove duplicated function prototype of X509_STORE_CTX_set_verify_cb(). --- crypto/x509/x509_vfy.c | 7 +++---- include/openssl/x509_vfy.h | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index efa6bcaa67..8f8847da91 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -2161,11 +2161,10 @@ int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, /* Zero ex_data to make sure we're cleanup-safe */ memset(&ctx->ex_data, 0, sizeof(ctx->ex_data)); - if (store) { - ctx->verify_cb = store->verify_cb; - /* Seems to always be 0 in OpenSSL, else must be idempotent */ + /* Seems to always be 0 in OpenSSL, else must be idempotent */ + if (store && ctx->cleanup) ctx->cleanup = store->cleanup; - } else + else ctx->cleanup = 0; if (store && store->check_issued) diff --git a/include/openssl/x509_vfy.h b/include/openssl/x509_vfy.h index fa186a09d9..06232fb600 100644 --- a/include/openssl/x509_vfy.h +++ b/include/openssl/x509_vfy.h @@ -373,8 +373,6 @@ int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags); void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, time_t t); -void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx, - int (*verify_cb) (int, X509_STORE_CTX *)); X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(X509_STORE_CTX *ctx); int X509_STORE_CTX_get_explicit_policy(X509_STORE_CTX *ctx); -- cgit v1.2.3