Error: invalid use of incomplete type ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}?

g++ -Wall -O3 -m64 -march=core2 -mfpmath=sse -mssse3 -ggdb -fno-strict-aliasing -fno-strict-overflow -fwrapv -DCOMMIT=\"7cc19ad27b565157042b93c19e8af48c04254b19\" -fno-omit-frame-pointer -I common -I binlog -I net -I kfs -I drinkless -I skat -I vv -I objs -I . -c -MP -MD -MF dep/KPHP/runtime/openssl.d -MQ objs/KPHP/runtime/openssl.o -o objs/KPHP/runtime/openssl.o KPHP/runtime/openssl.cpp
KPHP/runtime/openssl.cpp: In function ‘bool f$openssl_public_encrypt(const string&, string&, const string&)’:
KPHP/runtime/openssl.cpp:275:11: error: invalid use of incomplete type ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA2) {
^~
In file included from /usr/include/openssl/err.h:20,
from KPHP/runtime/openssl.cpp:12:
/usr/include/openssl/ossl_typ.h:93:16: note: forward declaration of ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
typedef struct evp_pkey_st EVP_PKEY;
^~~~~~~~~~~
KPHP/runtime/openssl.cpp:275:41: error: invalid use of incomplete type ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA2) {
^~
In file included from /usr/include/openssl/err.h:20,
from KPHP/runtime/openssl.cpp:12:
/usr/include/openssl/ossl_typ.h:93:16: note: forward declaration of ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
typedef struct evp_pkey_st EVP_PKEY;
^~~~~~~~~~~
KPHP/runtime/openssl.cpp:290:77: error: invalid use of incomplete type ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
reinterpret_cast <unsigned char *> (php_buf), pkey->pkey.rsa, RSA_PKCS1_PADDING) != key_size) {
^~

In file included from /usr/include/openssl/err.h:20,
from KPHP/runtime/openssl.cpp:12:
/usr/include/openssl/ossl_typ.h:93:16: note: forward declaration of ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
typedef struct evp_pkey_st EVP_PKEY;
^~~~~~~~~~~
KPHP/runtime/openssl.cpp: In function ‘bool f$openssl_private_decrypt(const string&, string&, const string&)’:
KPHP/runtime/openssl.cpp:329:11: error: invalid use of incomplete type ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA2) {
^~
In file included from /usr/include/openssl/err.h:20,
from KPHP/runtime/openssl.cpp:12:
/usr/include/openssl/ossl_typ.h:93:16: note: forward declaration of ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
typedef struct evp_pkey_st EVP_PKEY;
^~~~~~~~~~~
KPHP/runtime/openssl.cpp:329:41: error: invalid use of incomplete type ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA2) {
^~
In file included from /usr/include/openssl/err.h:20,
from KPHP/runtime/openssl.cpp:12:
/usr/include/openssl/ossl_typ.h:93:16: note: forward declaration of ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
typedef struct evp_pkey_st EVP_PKEY;
^~~~~~~~~~~
KPHP/runtime/openssl.cpp:342:84: error: invalid use of incomplete type ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
reinterpret_cast <unsigned char *> (php_buf), pkey->pkey.rsa, RSA_PKCS1_PADDING);
^~

In file included from /usr/include/openssl/err.h:20,
from KPHP/runtime/openssl.cpp:12:
/usr/include/openssl/ossl_typ.h:93:16: note: forward declaration of ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
typedef struct evp_pkey_st EVP_PKEY;
^~~~~~~~~~~

код из самого файла penssl.cpp
if (pkey->type != EVP_PKEY_RSA && pkey->type != EVP_PKEY_RSA2) {
    if (!from_cache) {
      EVP_PKEY_free (pkey);
    }
    dl::leave_critical_section();

    php_warning ("Key type is neither RSA nor RSA2");
    result = string();
    return false;
  }

  int key_size = EVP_PKEY_size (pkey);
  php_assert (PHP_BUF_LEN >= key_size);

  if (RSA_public_encrypt ((int)data.size(), reinterpret_cast <const unsigned char *> (data.c_str()),
                          reinterpret_cast <unsigned char *> (php_buf), pkey->pkey.rsa, RSA_PKCS1_PADDING) != key_size) {
    if (!from_cache) {
      EVP_PKEY_free (pkey);
    }
    dl::leave_critical_section();

    php_warning ("RSA public encrypt failed");
    result = string();
    return false;
  }

код из файла ossl_typ.h
typedef struct evp_pkey_st EVP_PKEY;
  • Вопрос задан
  • 691 просмотр
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы