我打电话时遇到问题EVP_get_cipherbyname
在 macOS 上:
const char *cipher_str = "aes-256-cbc";
const evp_cipher_st *cipher1 = EVP_aes_256_cbc();
const evp_cipher_st *cipher2 = EVP_get_cipherbyname(cipher_str);
在上面的代码中,cipher1
将始终被设置为有效的evp_cipher_st *
对象,以及cipher2
将永远为空。我还没有找到一个实例cipher_str
产生一个非空的cipher2
.
难道我做错了什么?我还应该拨打其他电话才能使其正常工作吗?
您需要首先初始化 OpenSSL 库。如果你只使用 libcrypto,
称呼:
OpenSSL_add_all_algorithms();
参考https://wiki.openssl.org/index.php/Library_Initialization https://wiki.openssl.org/index.php/Library_Initialization了解如何处理其他情况或 openssl 版本。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)