@@ -197,7 +197,6 @@ using DeleteFnPtr = typename FunctionDeleter<T, function>::Pointer;
197
197
198
198
using BignumCtxPointer = DeleteFnPtr<BN_CTX, BN_CTX_free>;
199
199
using BignumGenCallbackPointer = DeleteFnPtr<BN_GENCB, BN_GENCB_free>;
200
- using ECGroupPointer = DeleteFnPtr<EC_GROUP, EC_GROUP_free>;
201
200
using ECKeyPointer = DeleteFnPtr<EC_KEY, EC_KEY_free>;
202
201
using ECPointPointer = DeleteFnPtr<EC_POINT, EC_POINT_free>;
203
202
using EVPKeyCtxPointer = DeleteFnPtr<EVP_PKEY_CTX, EVP_PKEY_CTX_free>;
@@ -852,6 +851,28 @@ class ECDSASigPointer final {
852
851
const BIGNUM* ps_ = nullptr ;
853
852
};
854
853
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
+
855
876
#ifndef OPENSSL_NO_ENGINE
856
877
class EnginePointer final {
857
878
public:
0 commit comments