Openssl 1.1.1d无效使用不完整的类型"struct dsa_st"
Openssl 1.1.1d invalid use of incomplete type ‘struct dsa_st’
我正在从openssl 1.0.2s迁移到1.1.1d,并得到以下错误。
我在openssl文档上搜索了一下,似乎调用字段已经改变了。我不确定我需要如何在代码中实现它。
const BIGNUM * const *KeyPairImpl::getField(const string &field) const
{
if (field == "P")
return &dsa_->p;
else if (field == "Q")
return &dsa_->q;
else if (field == "G")
return &dsa_->g;
else if (field == "X")
return &dsa_->priv_key;
else if (field == "Y")
return &dsa_->pub_key;
else
// unknown field name
return NULL;
}
错误
KeyPair.cpp: In member function ‘const BIGNUM* const* KeyPairImpl::getField(const std::string&) const’:
KeyPair.cpp:84: error: invalid use of incomplete type ‘struct dsa_st’
/usr/local/ssl_1.1.1d/include/openssl/ossl_typ.h:107: error: forward declaration of ‘struct dsa_st’
KeyPair.cpp:86: error: invalid use of incomplete type ‘struct dsa_st’
/usr/local/ssl_1.1.1d/include/openssl/ossl_typ.h:107: error: forward declaration of ‘struct dsa_st’
KeyPair.cpp:88: error: invalid use of incomplete type ‘struct dsa_st’
/usr/local/ssl_1.1.1d/include/openssl/ossl_typ.h:107: error: forward declaration of ‘struct dsa_st’
KeyPair.cpp:90: error: invalid use of incomplete type ‘struct dsa_st’
/usr/local/ssl_1.1.1d/include/openssl/ossl_typ.h:107: error: forward declaration of ‘struct dsa_st’
KeyPair.cpp:92: error: invalid use of incomplete type ‘struct dsa_st’
/usr/local/ssl_1.1.1d/include/openssl/ossl_typ.h:107: error: forward declaration of ‘struct dsa_st’
cc1plus: warnings being treated as errors
Openssl 1.1.1不再允许直接访问内部结构。您需要使用提供的API函数来访问内部数据(如果提供(。
对于dsa_->p,请使用dsa_get0_p
对于dsa_->q,使用dsa_get0_q
对于dsa_->g,请使用dsa_get0_g
对于dsa_->priva_key,请使用dsa_get0_prival_key
对于dsa_->pub_key,请使用dsa_get0_pub_key
例如
return DSA_get0_p(dsa_);
相关文章:
- std::map<struct,struct>::find 找不到匹配项,但是如果我循环通过 begin() 到 end(),我在那里看到匹配项
- Openssl 1.1.1d无效使用不完整的类型"struct dsa_st"
- C++Union/Struct位域的实现和可移植性
- 如何在c++中定义以struct为数据成员的类中的构造函数
- 结构体 S { int align; } 之间的区别;(struct 关键字后的名称)和 struct { int al
- struct.error:解压缩 C++ 结构时,解包需要 288 字节的缓冲区
- 错误:"Left of getValue must have class/struct/union"
- 在 SVM-Struct 中未定义对 sqrt 的引用(已使用 -lm)
- 数据类型"struct seq<0, 1, 2>{}"含义是什么?
- 附加使用 Struct 作为"multikey"并将 std::vector 用作映射值的映射
- QML/C++/QObject Struct Copy
- 如何在 cpp 中解压缩数字,如果它们是使用 struct.pack(fmt, v1, v2, ..) 打包在 pyth
- Msgpack能否提供更好的性能和与Python的struct.pack()相同的功能?
- 将向量传递给<struct> Lua 表
- MPI_DOUBLE_INT and C++ struct
- C++ 中的"template <typename From, typename Tag> struct Alias;"是什么?
- 如何使用Struct打印交换函数
- 返回类型为struct的函数每次调用时都不返回任何内容
- 对struct::struct的未定义引用是什么意思
- 在c++Primer中使用Struct和Vector时出现错误C2661