Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fails on Debian Testing #4

Open
niansa opened this issue Feb 6, 2023 · 1 comment
Open

Compilation fails on Debian Testing #4

niansa opened this issue Feb 6, 2023 · 1 comment

Comments

@niansa
Copy link

niansa commented Feb 6, 2023

Hey!

I am getting this error:

gcc -c -Wall -O2 -fomit-frame-pointer -Wdeclaration-after-statement -I/usr/local/include     -mavx -DHAVE_CRYPT -DHAVE_DL -funroll-loops ssh_fmt.c
ssh_fmt.c:56:18: error: field ‘pk’ has incomplete type
   56 |         EVP_PKEY pk;
      |                  ^~

Any help is appreciated :-)

@ralberth
Copy link

ralberth commented Dec 6, 2024

I'm seeing the same thing on a clean build on my Linux box.

gcc -c -Wall -O2 -fomit-frame-pointer -Wdeclaration-after-statement -I/usr/local/include     -funroll-loops ssh_fmt.c
ssh_fmt.c:55:18: error: field ‘pk’ has incomplete type
   55 |         EVP_PKEY pk;
      |                  ^~


ssh_fmt.c: In function ‘EVP_DecryptFinal_ex_safe’:
ssh_fmt.c:118:16: error: invalid use of incomplete typedef ‘EVP_CIPHER_CTX’ {aka ‘struct evp_cipher_ctx_st’}
  118 |         if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) {



ssh_fmt.c:167:24: error: storage size of ‘ctx’ isn’t known
  167 |         EVP_CIPHER_CTX ctx;

(many other similar errors)

The sequence of includes: ssh_fmt.c:18 --> ssl.h --> x509.h --> evp.h.

All ".h" files are under /usr/include/openssl

Openssl docs for EVP_PKEY: https://docs.openssl.org/3.0/man3/EVP_PKEY_new/#description shows this defined as

#include <openssl/evp.h>

typedef evp_pkey_st EVP_PKEY;

I found this in file /usr/include/openssl/types.h:

typedef struct evp_pkey_st EVP_PKEY;

however, I couldn't find a definition for struct evp_pkey_st anywhere in /usr/include/openssl:

grep evp_pkey_st /usr/include/openssl/*.h
/usr/include/openssl/ssl.h:struct evp_pkey_st *SSL_get_privatekey(const SSL *ssl);
/usr/include/openssl/types.h:typedef struct evp_pkey_st EVP_PKEY;

No dice. Expand the search:

find /usr/include  -name '*.h' -exec grep evp_pkey_st {} \;
typedef struct evp_pkey_st EVP_PKEY;
/usr/include/openssl/types.h
struct evp_pkey_st *SSL_get_privatekey(const SSL *ssl);
/usr/include/openssl/ssl.h

That tells me openssl requires another library to supply this struct based on its implementation maybe, or hardware architecture?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants