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

Fix OpenSSL3 crypto lib load of rest plugin #223

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

embeddeddev
Copy link
Contributor

To deconz-rest-plugin was added the feature to use install codes for pairing (e.g. used by Bosch Smart Home devices).

The docker for amd64 uses the Ubuntu deb package.
This seems to be linked against libcrypto.so, whereas Debian docker base provides only libcrypto.so.3 library link.

Unfortunately the code does not log any failure on library loading.
After identification and test the problem was resolved by adding the required symlink libcrypto.so -> libcrypto.so.3 to the Docker container.

After that joining devices that require install codes works like a charm.

Method that adds install code support: RestDevices::putDeviceInstallCode
(https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/rest_devices.cpp#L1029)

Utility function that uses OpenSSL 3 crypto library w/o failure logging of missing library: CRYPTO_GetMmoHashFromInstallCode
(https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/crypto/mmohash.cpp#L99)

@phdelodder
Copy link
Collaborator

Looks good I'll merge it later today

@phdelodder
Copy link
Collaborator

@embeddeddev The build process failed: buildx failed with: ERROR: failed to solve: process "/bin/sh -c cd /usr/lib/x86_64-linux-gnu && ln -s libcrypto.so.3 libcrypto.so" did not complete successfully: exit code: 2

@embeddeddev
Copy link
Contributor Author

Sorry, for the inconvenience. My fix addressed builds for linux/amd64 only.
Don't know the status of the other platforms (armv7/arm64).
Both at least the platform depending library directory differs for those and it's not testable out of the box for me.

@phdelodder phdelodder merged commit 3baace7 into deconz-community:main Dec 5, 2023
1 check passed
@jmue
Copy link
Contributor

jmue commented Jan 20, 2024

This is also an workaround on debian/arm64 (RPI):
cd /usr/lib/aarch64-linux-gnu && ln -s libcrypto.so.3 libcrypto.so ; fi
So you should link to libcrypto.so.3 instead of libcrypto.so?

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

Successfully merging this pull request may close these issues.

3 participants