[OHOS ERROR] ../../base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/signature/src/signature_rsa_openssl.c:226:31: error: invalid operands to binary expression ('char[15]' and 'EVP_MD *' (aka 'struct evp_md_st *')) [OHOS ERROR] LOGE("hyp opensslAlg"+ opensslAlg); [OHOS ERROR] 错误分析
时间: 2024-04-23 11:25:01 浏览: 22
这是一个编译错误报告,指出在文件 signature_rsa_openssl.c 的第 226 行,有一个二进制表达式的操作数类型不匹配。具体来说,它试图将一个字符数组 'char[15]' 和一个结构体指针 'EVP_MD *' 相加,这是不允许的。该错误可能是由于代码中某些类型的错误转换或错误指针使用引起的。
在第二行中,代码试图打印一个字符串和一个变量 opensslAlg,但是两者之间没有任何分隔符。这可能会导致编译错误或运行时错误。
建议检查代码中的类型声明和指针使用,查找可能导致此错误的语法错误和逻辑错误。同时,将字符串和变量分开打印,或使用格式化字符串进行输出。
相关问题
undefined symbol: Openssl_EVP_sm4_cfb [OHOS ERROR] >>> referenced by cipher_sm4_openssl.c:0 (../../base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/cipher/src/cipher_sm4_openssl.c:0) [OHOS ERROR] >>> obj/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/cipher/src/crypto_framework_test/cipher_sm4_openssl.o:(EngineCipherInit) 此问题解决方法
这个问题可能是因为您的 OpenSSL 版本过低,没有包含支持 SM4 加密算法的模块。您可以尝试升级 OpenSSL 版本或者重新编译 OpenSSL,确保它包含了 SM4 加密算法的支持。另外,您还可以检查是否正确设置了 OpenSSL 库的路径和链接参数。如果您需要更具体的帮助,请提供更多的上下文信息,例如操作系统、编程语言和编译器等。
问题解决 [OHOS ERROR] ld.lld: error: undefined symbol: Openssl_EVP_sm4_ecb [OHOS ERROR] >>> referenced by cipher_sm4_openssl.c:0 (../../base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/cipher/src/cipher_sm4_openssl.c:0) [OHOS ERROR] >>> obj/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/cipher/src/crypto_framework_test/cipher_sm4_openssl.o:(EngineCipherInit) [OHOS ERROR] [OHOS ERROR] ld.lld: error: undefined symbol: Openssl_EVP_sm4_cbc [OHOS ERROR] >>> referenced by cipher_sm4_openssl.c:0 (../../base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/cipher/src/cipher_sm4_openssl.c:0) [OHOS ERROR] >>> obj/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/cipher/src/crypto_framework_test/cipher_sm4_openssl.o:(EngineCipherInit) [OHOS ERROR]
这个错误是由于缺少 OpenSSL EVP SM4 ECB 和 OpenSSL EVP SM4 CBC 符号导致的。可能是因为在编译时没有正确链接 OpenSSL 库或者 OpenSSL 库版本不兼容所致。您可以尝试更新 OpenSSL 库或者检查编译时是否正确链接了 OpenSSL 库。同时您也可以尝试在编译时添加 `-lcrypto` 参数链接 OpenSSL 库。如果问题仍然存在,您可以提供更多的上下文信息,以便更好地解决问题。