From b6155e60f3eab82ce35c27de90b642f59d26598b Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Fri, 25 Dec 2015 00:58:34 -0500 Subject: [PATCH] Remove app_data from EVP_PKEY_CTX. It's never used. It's not clear why one would want such a thing. EVP_PKEY_CTX has no way for callers to register callbacks, which means there shouldn't be a way for the library to present you an EVP_PKEY_CTX out-of-context. (Whereas app_data/ex_data makes sense on SSL because of its numerous callbacks or RSA because of RSA_METHOD.) Change-Id: I55af537ab101682677af34f6ac1f2c27b5899a89 Reviewed-on: https://boringssl-review.googlesource.com/6849 Reviewed-by: Adam Langley --- crypto/evp/evp_ctx.c | 6 ------ crypto/evp/internal.h | 2 -- include/openssl/evp.h | 8 -------- 3 files changed, 16 deletions(-) diff --git a/crypto/evp/evp_ctx.c b/crypto/evp/evp_ctx.c index e2f4bee6..b06eefd6 100644 --- a/crypto/evp/evp_ctx.c +++ b/crypto/evp/evp_ctx.c @@ -193,12 +193,6 @@ err: EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx) { return ctx->pkey; } -void EVP_PKEY_CTX_set_app_data(EVP_PKEY_CTX *ctx, void *data) { - ctx->app_data = data; -} - -void *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx) { return ctx->app_data; } - int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, int cmd, int p1, void *p2) { if (!ctx || !ctx->pmeth || !ctx->pmeth->ctrl) { diff --git a/crypto/evp/internal.h b/crypto/evp/internal.h index fa57ae96..3acc3614 100644 --- a/crypto/evp/internal.h +++ b/crypto/evp/internal.h @@ -218,8 +218,6 @@ struct evp_pkey_ctx_st { int operation; /* Algorithm specific data */ void *data; - /* Application specific data */ - void *app_data; } /* EVP_PKEY_CTX */; struct evp_pkey_method_st { diff --git a/include/openssl/evp.h b/include/openssl/evp.h index adf586e8..2ec88616 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -428,14 +428,6 @@ OPENSSL_EXPORT EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *ctx); /* EVP_PKEY_CTX_get0_pkey returns the |EVP_PKEY| associated with |ctx|. */ OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx); -/* EVP_PKEY_CTX_set_app_data sets an opaque pointer on |ctx|. */ -OPENSSL_EXPORT void EVP_PKEY_CTX_set_app_data(EVP_PKEY_CTX *ctx, void *data); - -/* EVP_PKEY_CTX_get_app_data returns the opaque pointer from |ctx| that was - * previously set with |EVP_PKEY_CTX_set_app_data|, or NULL if none has been - * set. */ -OPENSSL_EXPORT void *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx); - /* EVP_PKEY_sign_init initialises an |EVP_PKEY_CTX| for a signing operation. It * should be called before |EVP_PKEY_sign|. *