Stop tracking an ENGINE in EVP_PKEY_CTX

We don't use this field. We just save what the caller passed in and then
ignore it.

Change-Id: I962b7bfbc9aa7cec70244acd2b13ccfa21e53575
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/81528
Commit-Queue: Lily Chen <chlily@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Lily Chen <chlily@google.com>
diff --git a/crypto/evp/evp_ctx.cc b/crypto/evp/evp_ctx.cc
index 9814606..31d0ca9 100644
--- a/crypto/evp/evp_ctx.cc
+++ b/crypto/evp/evp_ctx.cc
@@ -40,14 +40,13 @@
   return nullptr;
 }
 
-static EVP_PKEY_CTX *evp_pkey_ctx_new(EVP_PKEY *pkey, ENGINE *e,
+static EVP_PKEY_CTX *evp_pkey_ctx_new(EVP_PKEY *pkey,
                                       const EVP_PKEY_CTX_METHOD *pmeth) {
   bssl::UniquePtr<EVP_PKEY_CTX> ret = bssl::MakeUnique<EVP_PKEY_CTX>();
   if (!ret) {
     return nullptr;
   }
 
-  ret->engine = e;
   ret->pmeth = pmeth;
   ret->operation = EVP_PKEY_OP_UNDEFINED;
   ret->pkey = bssl::UpRef(pkey);
@@ -73,7 +72,7 @@
     return NULL;
   }
 
-  return evp_pkey_ctx_new(pkey, e, pkey_method);
+  return evp_pkey_ctx_new(pkey, pkey_method);
 }
 
 EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e) {
@@ -84,7 +83,7 @@
     return NULL;
   }
 
-  return evp_pkey_ctx_new(NULL, e, pkey_method);
+  return evp_pkey_ctx_new(NULL, pkey_method);
 }
 
 evp_pkey_ctx_st::~evp_pkey_ctx_st() {
@@ -106,7 +105,6 @@
   }
 
   ret->pmeth = ctx->pmeth;
-  ret->engine = ctx->engine;
   ret->operation = ctx->operation;
   ret->pkey = bssl::UpRef(ctx->pkey);
   ret->peerkey = bssl::UpRef(ctx->peerkey);
diff --git a/crypto/evp/internal.h b/crypto/evp/internal.h
index f82f8ab..51cfa64 100644
--- a/crypto/evp/internal.h
+++ b/crypto/evp/internal.h
@@ -178,8 +178,6 @@
 
   // Method associated with this operation
   const EVP_PKEY_CTX_METHOD *pmeth = nullptr;
-  // Engine that implements this method or nullptr if builtin
-  ENGINE *engine = nullptr;
   // Key: may be nullptr
   bssl::UniquePtr<EVP_PKEY> pkey;
   // Peer key for key agreement, may be nullptr