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

LibreSSL 3.7.x doesn't have RAND_OpenSSL() #840

Closed
orbea opened this issue Apr 13, 2023 · 2 comments
Closed

LibreSSL 3.7.x doesn't have RAND_OpenSSL() #840

orbea opened this issue Apr 13, 2023 · 2 comments

Comments

@orbea
Copy link

orbea commented Apr 13, 2023

When building tpm2-tss it fails since OpenSSL_rand() is not implemented.

https://github.com/tpm2-software/tpm2-tss/blob/3d3c9a81db1354fe75dd27f5a87551c101034b0d/src/tss2-esys/esys_crypto_ossl.c#L561

This can be easily worked around.

#ifdef LIBRESSL_VERSION_NUMBER
    RAND_set_rand_method(RAND_SSLeay());
#else
    RAND_set_rand_method(RAND_OpenSSL());
#endif

But reading LibreSSL's documentation it shows that RAND_set_rand_method() and RAND_SSLeay() doesn't really do anything. Perhaps the same should be for RAND_OpenSSL()?

I made WIP upstream PR here. tpm2-software/tpm2-tss#2380

@4a6f656c
Copy link
Contributor

RAND_set_rand_method() and RAND_OpenSSL() are deprecated in OpenSSL 3.0 onwards:

https://www.openssl.org/docs/man3.0/man3/RAND_set_rand_method.html

For upstream patches, I would recommend using:

#ifndef LIBRESSL_VERSION_NUMBER
RAND_set_rand_method(RAND_OpenSSL());
#endif

Or potentially removing/replacing the code in question.

@orbea
Copy link
Author

orbea commented Apr 15, 2023

RAND_set_rand_method() and RAND_OpenSSL() are deprecated in OpenSSL 3.0 onwards:

Thanks for pointing that out, I missed that detail. It doesn't seem to make sense to start adding deprecated functions so I will close this.

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