Skip to content

echo_server example fails to build for ESP32 due to redefinition of certs #826

@fastjack

Description

@fastjack

I tried to build the echo_server example as described on the WolfSSL page at https://www.wolfssl.com/wolfssh-now-available-as-an-espressif-managed-component-includes-ssh-echo-server-example/

I'm using ESP-IDF 5.5 on macOS. I created the example project with: idf.py create-project-from-example "wolfssl/wolfssh:wolfssh_echoserver". Configured Wifi credentials with menuconfig and then tried to build the project with idf.py build.

But the project failed to build with the following messages:

In file included from /Users/fastjack/Developer/IoT/wolfssh_echoserver/main/echoserver.c:65:
/Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssh/wolfssh/certs_test.h:27:28: error: redefinition of 'rsa_key_der_2048'
   27 | static const unsigned char rsa_key_der_2048[] =
      |                            ^~~~~~~~~~~~~~~~
In file included from /Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssl/include/user_settings.h:1062,
                 from /Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssl/wolfssl/wolfcrypt/settings.h:340,
                 from /Users/fastjack/Developer/IoT/wolfssh_echoserver/main/echoserver.c:29:
/Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssl/wolfssl/certs_test.h:1384:28: note: previous definition of 'rsa_key_der_2048' with type 'const unsigned char[1191]'
 1384 | static const unsigned char rsa_key_der_2048[] =
      |                            ^~~~~~~~~~~~~~~~
/Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssh/wolfssh/certs_test.h:150:18: error: redefinition of 'sizeof_rsa_key_der_2048'
  150 | static const int sizeof_rsa_key_der_2048 = sizeof(rsa_key_der_2048);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~
/Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssl/wolfssl/certs_test.h:1507:18: note: previous definition of 'sizeof_rsa_key_der_2048' with type 'int'
 1507 | static const int sizeof_rsa_key_der_2048 = sizeof(rsa_key_der_2048);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~
/Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssh/wolfssh/certs_test.h:153:28: error: redefinition of 'ecc_key_der_256'
  153 | static const unsigned char ecc_key_der_256[] =
      |                            ^~~~~~~~~~~~~~~
/Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssl/wolfssl/certs_test.h:6187:28: note: previous definition of 'ecc_key_der_256' with type 'const unsigned char[121]'
 6187 | static const unsigned char ecc_key_der_256[] =
      |                            ^~~~~~~~~~~~~~~
/Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssh/wolfssh/certs_test.h:169:18: error: redefinition of 'sizeof_ecc_key_der_256'
  169 | static const int sizeof_ecc_key_der_256 = sizeof(ecc_key_der_256);
      |                  ^~~~~~~~~~~~~~~~~~~~~~
/Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssl/wolfssl/certs_test.h:6203:18: note: previous definition of 'sizeof_ecc_key_der_256' with type 'int'
 6203 | static const int sizeof_ecc_key_der_256 = sizeof(ecc_key_der_256);
      |                  ^~~~~~~~~~~~~~~~~~~~~~

Steps to reproduce:

  1. Set up ESP-IDF paths with source ~/esp/v5.5/esp-idf/export.sh
  2. idf.py create-project-from-example "wolfssl/wolfssh:wolfssh_echoserver"
  3. Enter project directory and build with idf.py build

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions