openssl3.2中有很多 xx_fetch API, 用字符串名称来找openssl任务的指针.
因为参数是字符串名称, 如果是新手, 就不知道这些字符串该怎么写, 如果没有研究方法, 只能是看见官方和第三方工程写什么, 我们就写什么.
但是, 如果要用到的字符串名称和官方的不一样, 这时候, 就需要自己研究. 否则, 字符串写错, 是得不到openssl任务指针的.
前面我发现这个问题, 已经将EVP_MD_fetch(), EVP_CIPHER_fetch()的字符串名称参数有效值列表搞出来了.
这几天又陆续在官方demo中看到, 有xx_fetch()的API, 看来官方就是推荐用任务名称来找任务指针.
今天搜了一下, 将 xx_fetch()函数都列出来, 等有时间时, 将这些API参数中的字符串名称有效值列表都整理出来
include\openssl
crypto\evp
include\internal
providers\common\include\prov
ssl
crypto\store
安装好(给openssl外部应用 用的API)的openssl目录只有 include\openssl
其他目录, 只有openssl工具(openssl.exe)或内部测试程序才用.
decoder.h (include\openssl)
encoder.h (include\openssl)
evp.h (include\openssl)
evp_local.h (crypto\evp)
kdf.h (include\openssl)
property.h (include\internal)
provider_util.h (providers\common\include\prov)
ssl_local.h (ssl)
store.h (include\openssl)
store_local.h (crypto\store)
OSSL_DECODER *OSSL_DECODER_fetch(OSSL_LIB_CTX *libctx, const char *name, const char *properties);
OSSL_ENCODER *OSSL_ENCODER_fetch(OSSL_LIB_CTX *libctx, const char *name, const char *properties);
EVP_CIPHER *EVP_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties);
__owur EVP_MD *EVP_MD_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties);
EVP_MAC *EVP_MAC_fetch(OSSL_LIB_CTX *libctx, const char *algorithm, const char *properties);
EVP_RAND *EVP_RAND_fetch(OSSL_LIB_CTX *libctx, const char *algorithm, const char *properties);
EVP_KEYMGMT *EVP_KEYMGMT_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties);
EVP_SIGNATURE *EVP_SIGNATURE_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties);
EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties);
EVP_KEM *EVP_KEM_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties);
EVP_KEYEXCH *EVP_KEYEXCH_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties);
EVP_KEYMGMT *evp_keymgmt_fetch_from_prov(OSSL_PROVIDER *prov, const char *name, const char *properties);
void *evp_generic_fetch(OSSL_LIB_CTX *ctx, int operation_id,
const char *name, const char *properties,
void *(*new_method)(int name_id,
const OSSL_ALGORITHM *algodef,
OSSL_PROVIDER *prov),
int (*up_ref_method)(void *),
void (*free_method)(void *));
void *evp_generic_fetch_from_prov(OSSL_PROVIDER *prov, int operation_id,
const char *name, const char *properties,
void *(*new_method)(int name_id,
const OSSL_ALGORITHM *algodef,
OSSL_PROVIDER *prov),
int (*up_ref_method)(void *),
void (*free_method)(void *));
EVP_KEYMGMT *evp_keymgmt_fetch_by_number(OSSL_LIB_CTX *ctx, int name_id,
const char *properties);
EVP_SIGNATURE *evp_signature_fetch_from_prov(OSSL_PROVIDER *prov,
const char *name,
const char *properties);
EVP_ASYM_CIPHER *evp_asym_cipher_fetch_from_prov(OSSL_PROVIDER *prov,
const char *name,
const char *properties);
EVP_KEYEXCH *evp_keyexch_fetch_from_prov(OSSL_PROVIDER *prov,
const char *name,
const char *properties);
EVP_KEM *evp_kem_fetch_from_prov(OSSL_PROVIDER *prov,
const char *name,
const char *properties);
EVP_KDF *EVP_KDF_fetch(OSSL_LIB_CTX *libctx, const char *algorithm,
const char *properties);
int ossl_method_store_fetch(OSSL_METHOD_STORE *store,
int nid, const char *prop_query,
const OSSL_PROVIDER **prov, void **method);
const EVP_MD *ossl_prov_digest_fetch(PROV_DIGEST *pd, OSSL_LIB_CTX *libctx,
const char *mdname, const char *propquery);
const EVP_CIPHER *ssl_evp_cipher_fetch(OSSL_LIB_CTX *libctx,
int nid,
const char *properties);
const EVP_MD *ssl_evp_md_fetch(OSSL_LIB_CTX *libctx,
int nid,
const char *properties);
OSSL_STORE_LOADER *OSSL_STORE_LOADER_fetch(OSSL_LIB_CTX *libctx,
const char *scheme,
const char *properties);
OSSL_STORE_LOADER *ossl_store_loader_fetch(OSSL_LIB_CTX *libctx,
const char *scheme,
const char *properties);
xx_fetch的数量为26个
找每个xx_fetch()函数的参数字符串名称有效值时, 都有附带的头文件定义, 具体的有效值整理.
在一个笔记中写全是不可能的. 这个笔记作为一个索引贴, 给出其他具体xx_fetch()的有效值笔记.
我现在才搞清楚2个, 以后慢慢来填坑.
\todo
\todo
openssl3.2 - EVP_CIPHER_fetch算法名称字符串(参数2)的有效值列表
openssl3.2 - EVP_MD_fetch算法名称字符串(参数2)的有效值列表
\todo
\todo
\todo
\todo
\todo
\todo
\todo
\todo
\todo
\todo
\todo
\todo
\todo
\todo
\todo
\todo
\todo
\todo
\todo
\todo
\todo
\todo