ASSERT(ciphername);
ciphername = translate_cipher_name_from_openvpn(ciphername);
- cipher = EVP_get_cipherbyname(ciphername);
+ cipher = EVP_CIPHER_fetch(NULL, ciphername, NULL);
if (NULL == cipher)
{
strcpy(mode_str, "-CBC");
- cbc_cipher = EVP_get_cipherbyname(translate_cipher_name_from_openvpn(name));
+ cbc_cipher = EVP_CIPHER_fetch(NULL,translate_cipher_name_from_openvpn(name), NULL);
if (cbc_cipher)
{
block_size = EVP_CIPHER_block_size(cbc_cipher);
{
const EVP_MD *md = NULL;
ASSERT(digest);
- md = EVP_get_digestbyname(digest);
+ md = EVP_MD_fetch(NULL, digest, NULL);
if (!md)
{
crypto_msg(M_FATAL, "Message hash algorithm '%s' not found", digest);
return 1;
}
#endif
+
+#if OPENSSL_VERSION_NUMBER < 0x30000000L
+/* Mimics the functions but only when the default context without
+ * options is chosen */
+static inline const EVP_CIPHER *
+EVP_CIPHER_fetch(void *ctx, const char *algorithm, const char *properties)
+{
+ ASSERT(!ctx);
+ ASSERT(!properties);
+ return EVP_get_cipherbyname(algorithm);
+}
+
+static inline const EVP_MD*
+EVP_MD_fetch(void *ctx, const char *algorithm, const char *properties)
+{
+ ASSERT(!ctx);
+ ASSERT(!properties);
+ return EVP_get_digestbyname(algorithm);
+}
+#endif /* OPENSSL_VERSION_NUMBER < 0x30000000L */
+
#endif /* OPENSSL_COMPAT_H_ */