@@ -197,7 +197,6 @@ using DeleteFnPtr = typename FunctionDeleter<T, function>::Pointer;
197197
198198using BignumCtxPointer = DeleteFnPtr<BN_CTX, BN_CTX_free>;
199199using BignumGenCallbackPointer = DeleteFnPtr<BN_GENCB, BN_GENCB_free>;
200- using ECGroupPointer = DeleteFnPtr<EC_GROUP, EC_GROUP_free>;
201200using ECKeyPointer = DeleteFnPtr<EC_KEY, EC_KEY_free>;
202201using ECPointPointer = DeleteFnPtr<EC_POINT, EC_POINT_free>;
203202using EVPKeyCtxPointer = DeleteFnPtr<EVP_PKEY_CTX, EVP_PKEY_CTX_free>;
@@ -852,6 +851,28 @@ class ECDSASigPointer final {
852851 const BIGNUM* ps_ = nullptr ;
853852};
854853
854+ class ECGroupPointer final {
855+ public:
856+ explicit ECGroupPointer ();
857+ explicit ECGroupPointer (EC_GROUP* group);
858+ ECGroupPointer (ECGroupPointer&& other) noexcept ;
859+ ECGroupPointer& operator =(ECGroupPointer&& other) noexcept ;
860+ NCRYPTO_DISALLOW_COPY (ECGroupPointer)
861+ ~ECGroupPointer ();
862+
863+ inline bool operator ==(std::nullptr_t ) noexcept { return group_ == nullptr ; }
864+ inline operator bool () const { return group_ != nullptr ; }
865+ inline EC_GROUP* get () const { return group_.get (); }
866+ inline operator EC_GROUP*() const { return group_.get (); }
867+ void reset (EC_GROUP* group = nullptr );
868+ EC_GROUP* release ();
869+
870+ static ECGroupPointer NewByCurveName (int nid);
871+
872+ private:
873+ DeleteFnPtr<EC_GROUP, EC_GROUP_free> group_;
874+ };
875+
855876#ifndef OPENSSL_NO_ENGINE
856877class EnginePointer final {
857878 public:
0 commit comments