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

Fails to build with tlsdate-helper.c:377:11: error: invalid use of incomplete typedef ‘SSL’ {aka ‘const struct ssl_st’} and subsequent errors. #207

Open
dreirund opened this issue Feb 16, 2024 · 0 comments

Comments

@dreirund
Copy link

dreirund commented Feb 16, 2024

I am trying to build on Artix GNU/Linux (rolling release, so software is pretty much up to date) for x86_64 architecture the latest git checkout as well as release 0.0.13.

It fails to build with tlsdate-helper.c:377:11: error: invalid use of incomplete typedef ‘SSL’ {aka ‘const struct ssl_st’} and subsequent errors:

make  all-am
make[1]: Entering directory '/tmp/makepkg/build/tlsdate-git/src/tlsdate-git'
  CC       src/tlsdate-tlsdate.o
  CCLD     src/tlsdate
  CC       src/tlsdate_helper-seccomp.o
  CC       src/tlsdate_helper-tlsdate-helper.o
src/tlsdate-helper.c: In function ‘openssl_time_callback’:
src/tlsdate-helper.c:377:11: error: invalid use of incomplete typedef ‘SSL’ {aka ‘const struct ssl_st’}
  377 |       (ssl->state == SSL3_ST_CR_SRVR_HELLO_A || ssl->state == SSL3_ST_CR_SRVR_HELLO_B))
      |           ^~
src/tlsdate-helper.c:377:22: error: ‘SSL3_ST_CR_SRVR_HELLO_A’ undeclared (first use in this function); did you mean ‘TLS_ST_CR_SRVR_HELLO’?
  377 |       (ssl->state == SSL3_ST_CR_SRVR_HELLO_A || ssl->state == SSL3_ST_CR_SRVR_HELLO_B))
      |                      ^~~~~~~~~~~~~~~~~~~~~~~
      |                      TLS_ST_CR_SRVR_HELLO
src/tlsdate-helper.c:377:22: note: each undeclared identifier is reported only once for each function it appears in
src/tlsdate-helper.c:377:52: error: invalid use of incomplete typedef ‘SSL’ {aka ‘const struct ssl_st’}
  377 |       (ssl->state == SSL3_ST_CR_SRVR_HELLO_A || ssl->state == SSL3_ST_CR_SRVR_HELLO_B))
      |                                                    ^~
src/tlsdate-helper.c:377:63: error: ‘SSL3_ST_CR_SRVR_HELLO_B’ undeclared (first use in this function); did you mean ‘TLS_ST_CR_SRVR_HELLO’?
  377 |       (ssl->state == SSL3_ST_CR_SRVR_HELLO_A || ssl->state == SSL3_ST_CR_SRVR_HELLO_B))
      |                                                               ^~~~~~~~~~~~~~~~~~~~~~~
      |                                                               TLS_ST_CR_SRVR_HELLO
src/tlsdate-helper.c:390:29: error: invalid use of incomplete typedef ‘SSL’ {aka ‘const struct ssl_st’}
  390 |     memcpy(&server_time, ssl->s3->server_random, sizeof(uint32_t));
      |                             ^~
src/tlsdate-helper.c:398:37: error: invalid use of incomplete typedef ‘SSL’ {aka ‘const struct ssl_st’}
  398 |       X509_VERIFY_PARAM_set_time(ssl->ctx->cert_store->param,
      |                                     ^~
src/tlsdate-helper.c: In function ‘get_certificate_keybits’:
src/tlsdate-helper.c:414:21: error: invalid use of incomplete typedef ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
  414 |   switch (public_key->type)
      |                     ^~
src/tlsdate-helper.c:418:40: error: invalid use of incomplete typedef ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
  418 |       key_bits = BN_num_bits(public_key->pkey.rsa->n);
      |                                        ^~
src/tlsdate-helper.c:422:40: error: invalid use of incomplete typedef ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
  422 |       key_bits = BN_num_bits(public_key->pkey.rsa->n);
      |                                        ^~
src/tlsdate-helper.c:426:40: error: invalid use of incomplete typedef ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
  426 |       key_bits = BN_num_bits(public_key->pkey.dsa->p);
      |                                        ^~
src/tlsdate-helper.c:430:40: error: invalid use of incomplete typedef ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
  430 |       key_bits = BN_num_bits(public_key->pkey.dsa->p);
      |                                        ^~
src/tlsdate-helper.c:434:40: error: invalid use of incomplete typedef ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
  434 |       key_bits = BN_num_bits(public_key->pkey.dsa->p);
      |                                        ^~
src/tlsdate-helper.c:438:40: error: invalid use of incomplete typedef ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
  438 |       key_bits = BN_num_bits(public_key->pkey.dsa->p);
      |                                        ^~
src/tlsdate-helper.c:442:40: error: invalid use of incomplete typedef ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
  442 |       key_bits = BN_num_bits(public_key->pkey.dsa->p);
      |                                        ^~
src/tlsdate-helper.c:446:40: error: invalid use of incomplete typedef ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
  446 |       key_bits = BN_num_bits(public_key->pkey.dh->pub_key);
      |                                        ^~
src/tlsdate-helper.c: In function ‘check_san’:
src/tlsdate-helper.c:698:18: error: invalid use of incomplete typedef ‘X509_EXTENSION’ {aka ‘struct X509_extension_st’}
  698 |         tmp = ext->value->data;
      |                  ^~
src/tlsdate-helper.c:701:52: error: invalid use of incomplete typedef ‘X509_EXTENSION’ {aka ‘struct X509_extension_st’}
  701 |           extvalstr = ASN1_item_d2i(NULL, &tmp, ext->value->length,
      |                                                    ^~
src/tlsdate-helper.c:704:50: error: invalid use of incomplete typedef ‘X509_EXTENSION’ {aka ‘struct X509_extension_st’}
  704 |           extvalstr = method->d2i(NULL, &tmp, ext->value->length);
      |                                                  ^~
src/tlsdate-helper.c: In function ‘check_key_length’:
src/tlsdate-helper.c:889:48: error: invalid use of incomplete typedef ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
  889 |   if (MIN_PUB_KEY_LEN >= key_bits && public_key->type != EVP_PKEY_EC)
      |                                                ^~
src/tlsdate-helper.c:893:20: error: invalid use of incomplete typedef ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
  893 |      if (public_key->type == EVP_PKEY_EC)
      |                    ^~
src/tlsdate-helper.c: In function ‘run_ssl’:
src/tlsdate-helper.c:1194:27: error: invalid use of incomplete typedef ‘SSL’ {aka ‘struct ssl_st’}
 1194 |   memcpy(&result_time, ssl->s3->server_random, sizeof (uint32_t));
      |                           ^~
make[1]: *** [Makefile:2036: src/tlsdate_helper-tlsdate-helper.o] Error 1
make[1]: Leaving directory '/tmp/makepkg/build/tlsdate-git/src/tlsdate-git'
make: *** [Makefile:1431: all] Error 2

Fails to build for me on x86_64 with tlsdate-helper.c:377:11: error: invalid use of incomplete typedef ‘SSL’ {aka ‘const struct ssl_st’} and subsequent errors:

make[1]: Entering directory '/tmp/makepkg/build/tlsdate-git/src/tlsdate-git'
  CC       src/tlsdate-tlsdate.o
  CCLD     src/tlsdate
  CC       src/tlsdate_helper-seccomp.o
  CC       src/tlsdate_helper-tlsdate-helper.o
src/tlsdate-helper.c: In function ‘openssl_time_callback’:
src/tlsdate-helper.c:377:11: error: invalid use of incomplete typedef ‘SSL’ {aka ‘const struct ssl_st’}
  377 |       (ssl->state == SSL3_ST_CR_SRVR_HELLO_A || ssl->state == SSL3_ST_CR_SRVR_HELLO_B))
      |           ^~
[...]
rc/tlsdate-helper.c:1194:27: error: invalid use of incomplete typedef ‘SSL’ {aka ‘struct ssl_st’}
 1194 |   memcpy(&result_time, ssl->s3->server_random, sizeof (uint32_t));
      |                           ^~
make[1]: *** [Makefile:2036: src/tlsdate_helper-tlsdate-helper.o] Error 1

Building from https://github.com/mskd12/tlsdate succeeds.

Regards!

GCC version is 13.2.1

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

1 participant