未定义openssl 0.9.8 EVP EVP_PKEY_CTX
我正在使用openssl 0.9.8(目前无法更改为更高版本)。 我正在使用openssl evp api(evp-高级加密函数) 用aes加密so数据,用rsa加密密钥 呼吁:未定义openssl 0.9.8 EVP EVP_PKEY_CTX,c,encryption,openssl,C,Encryption,Openssl,我正在使用openssl 0.9.8(目前无法更改为更高版本)。 我正在使用openssl evp api(evp-高级加密函数) 用aes加密so数据,用rsa加密密钥 呼吁: EVP_PKEY_CTX *ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL); 导致编译错误: error: 'EVP_PKEY_CTX' was not declared in this scope 据此, VP_PKEY_CTX仅在1.0.0及更高版本中提供 但evp
EVP_PKEY_CTX *ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL);
导致编译错误:
error: 'EVP_PKEY_CTX' was not declared in this scope
据此,
VP_PKEY_CTX仅在1.0.0及更高版本中提供
但evp allready存在于0.9.8中。
那么,对于指针变量*CTX,我应该使用什么类型来代替EVP_PKEY_CTX呢
但evp allready存在于0.9.8中。那么,对于指针变量*CTX,我应该使用什么类型来代替EVP_PKEY_CTX呢
EVP_PKEY
和朋友可以在OpenSSL 0.9.8中找到。例如:
$ grep -R EVP_PKEY_new *
apps/req.c: if ((pkey=EVP_PKEY_new()) == NULL) goto end;
apps/apps.c: pkey = EVP_PKEY_new();
crypto/evp/p_lib.c:EVP_PKEY *EVP_PKEY_new(void)
...
但是我看不到OpenSSL 0.9.8中哪里有
EVP\u PKEY\u CTX\u new\u id
和EVP\u PKEY\u CTX
可用。这与医生告诉你的是一致的
$ grep -R EVP_PKEY_CTX_new_id *
$
$ grep -R EVP_PKEY_CTX *
crypto/cms/cms_sd.c: if (EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_SIGN,
crypto/cms/cms_sd.c: if (EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_SIGN,
$
EVP\u PKEY\u CTX\u new\u id
也是1.0.0的一部分。因此,您可能必须放弃EVP_PKEY_CTX_new_id和friends(或将支持移植到0.9.8中)。请参阅上的OpenSSL文档。