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

Switchtec-user v2.0 - Openssl downgrading dependency issue and resolution #337

Open
lgacnik opened this issue Aug 14, 2024 · 0 comments
Open

Comments

@lgacnik
Copy link

lgacnik commented Aug 14, 2024

I'm facing the issue with the Switchtec-user v2.0 release for Trident RevB FCA release. Problem arises from the openssl downgraded version, which switchtec 2.0 relies on, but isn't easily accessible anymore and is considered "dangerous" for use. Either case, the 'openssl-1.0.0' is apparently required to build this release using make. The thing is that the lowest version officially available on the openssl github repository is openssl-1.1.1. Trying to install switchtec 2.0 with this version gives the following error after a successful sudo ./configure:

lgacnik@DESKTOP-696DMCE:/mnt/c/WINDOWS/system32/switchtec-user-2.0-rc7$ sudo make
CC    lib/recovery.c
lib/recovery.c:45:10: fatal error: openssl/pem.h: No such file or directory
   45 | #include <openssl/pem.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:112: build/lib/recovery.o] Error 1

This is resolved by installing the libssl-dev package. However this is followed by the subsequent errors shown below:

lgacnik@DESKTOP-696DMCE:/mnt/c/WINDOWS/system32/switchtec-user-2.0-rc7$ sudo make
CC    lib/recovery.c
lib/recovery.c:73:13: error: static declaration of ‘RSA_get0_key’ follows non-static declaration
   73 | static void RSA_get0_key(const RSA *r, const BIGNUM **n,
      |             ^~~~~~~~~~~~
In file included from /usr/include/openssl/x509.h:25,
                 from /usr/include/openssl/pem.h:17,
                 from lib/recovery.c:45:
/usr/include/openssl/rsa.h:214:6: note: previous declaration of ‘RSA_get0_key’ was here
  214 | void RSA_get0_key(const RSA *r,
      |      ^~~~~~~~~~~~
lib/recovery.c: In function ‘RSA_get0_key’:
lib/recovery.c:77:9: error: dereferencing pointer to incomplete type ‘RSA’ {aka ‘const struct rsa_st’}
   77 |   *n = r->n;
      |         ^~
lib/recovery.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-initializer-overrides’
make: *** [Makefile:112: build/lib/recovery.o] Error 1

It seems certain API switchtec v2.0 is using is modified in the openssl-1.1.1 version that shouldn't be in the openssl-1.0.0 version.

This problem was resolved by accidentally installing the latest switchtec release, that is the Switchtec-user v4.2 Release, which appears to have these missing dependencies included. This means this issue I'm facing has likely been addressed for subsequent versions. However need the v2.0-rc7 specifically since it has the recovery utility the subsequent releases lack.

In any case this issue would likely not arise if I would be able to install the openssl-1.0.0 package. But since this is either not possible or not recommended by the Linux community, there might be a possibility to resolve this issue on switchtec end specifically for the mentioned release.

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