📅  最后修改于: 2023-12-03 15:30:38.048000             🧑  作者: Mango
The ERR_OSSL_EVP_UNSUPPORTED
error code is produced by the OpenSSL library when an operation is not supported by the cryptographic algorithm or function.
When using OpenSSL library for cryptographic operations, ERR_OSSL_EVP_UNSUPPORTED error can occur when an unsupported operation is attempted on a cryptographic algorithm or function. This error occurs when the requested operation is incompatible with the underlying cryptographic algorithm.
Suppose a program tries to encrypt data using an unsupported algorithm:
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
if (!ctx) {
//handle error...
}
if (EVP_EncryptInit_ex(ctx, EVP_camellia_128_cbc(), NULL, key, iv) != 1) {
//handle error...
}
if (EVP_EncryptUpdate(ctx, output, &outlen, input, inlen) != 1) {
//handle error...
}
if (EVP_EncryptFinal_ex(ctx, output + outlen, &tmplen) != 1) {
//handle error...
}
In this case, if the EVP_camellia_128_cbc()
function is not supported, an ERR_OSSL_EVP_UNSUPPORTED
error will be returned. Hence, it is essential to verify that the requested algorithm or function is supported before using it.
ERR_OSSL_EVP_UNSUPPORTED error in OpenSSL library can be caused by various factors, including unsupported cryptographic algorithms or functions, incompatible OpenSSL library version, or incorrect input data types. By verifying that the proper requirements are in place, developers can mitigate and handle such errors effectively.