15#if OPENSSL_VERSION_NUMBER < 0x30000000L
18#include <openssl/evp.h>
19#include <openssl/ec.h>
20#include <openssl/objects.h>
31 if (EVP_PKEY_get0_EC_KEY(pkey) ==
nullptr)
35 const EC_KEY *ec = EVP_PKEY_get0_EC_KEY(pkey);
36 const EC_GROUP *group = EC_KEY_get0_group(ec);
38 int nid = EC_GROUP_get_curve_name(group);
44 const char *curve = OBJ_nid2sn(nid);
46 std::strncpy(gname, curve, gname_sz - 1);
47 *gname_len = std::strlen(curve);
53static inline const EVP_CIPHER *
58 const EVP_CIPHER *cipher = EVP_get_cipherbyname(algorithm);
63 if (FIPS_mode() && !(EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_FIPS))
71static inline EVP_PKEY *
79 return PEM_read_bio_PrivateKey(bp, x, cb, u);
89static inline SSL_CTX *
92 return SSL_CTX_new(meth);
99#define EVP_PKEY_get_bits EVP_PKEY_bits
101static inline const EVP_MD *
104 return EVP_get_digestbyname(algorithm);
static void EVP_CIPHER_free(const EVP_CIPHER *cipher)
static SSL_CTX * SSL_CTX_new_ex(void *libctx, const char *propq, const SSL_METHOD *meth)
static const EVP_CIPHER * EVP_CIPHER_fetch(void *ctx, const char *algorithm, const char *properties)
static EVP_PKEY * PEM_read_bio_PrivateKey_ex(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u, void *libctx, const char *propq)
static void OSSL_LIB_CTX_free(void *libctx)
static void EVP_MD_free(const EVP_MD *md)
static int EVP_PKEY_get_group_name(EVP_PKEY *pkey, char *gname, size_t gname_sz, size_t *gname_len)
static const EVP_MD * EVP_MD_fetch(void *, const char *algorithm, const char *)