Skip to content

Commit

Permalink
lib/openssl/UniqueEC: add UniqueEC_POINT
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Oct 24, 2023
1 parent 39b2e52 commit 5196d76
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/lib/openssl/UniqueEC.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@

#include <memory>

#if OPENSSL_API_LEVEL < 30000

struct ECDeleter {
#if OPENSSL_API_LEVEL < 30000
void operator()(EC_KEY *key) noexcept {
EC_KEY_free(key);
}
#endif

void operator()(EC_POINT *p) noexcept {
EC_POINT_free(p);
}
};

#if OPENSSL_API_LEVEL < 30000
using UniqueEC_KEY = std::unique_ptr<EC_KEY, ECDeleter>;

#endif

using UniqueEC_POINT = std::unique_ptr<EC_POINT, ECDeleter>;

0 comments on commit 5196d76

Please sign in to comment.