You are not logged in.
Pages: 1
Hi All,
i have a quick code example and i don't know why this is not working.
This seems to be a reayll beginner issue, but maybe you can support:
i included mormot2 in the search clauses, but when accessing the functions from mormot i get an error:
[dcc32 Fehler] Project1.dpr(16): E2003 Undeklarierter Bezeichner: 'OpenSslIsAvailable'
[dcc32 Fehler] Project1.dpr(19): E2003 Undeklarierter Bezeichner: 'OpenSslVersion'
Can you give me an advice why?
Thanks for your support!
Offline
On Windows, you need to explicitly enable OpenSSL linking by setting the USE_OPENSSL conditional for your whole project.
Then mormot.lib.openssl.pas will link the OpenSSL code.
I have modified the source code comments to make it more obvious.
https://github.com/synopse/mORMot2/commit/51f60003
Online
Hello ab,
really thanks for your quick answer!
it works now
When spending more time with your openssl library i searched for a possibility to get the full openssl version as here:
https://www.openssl.org/docs/man3.1/man … _TEXT.html
Currently i have the possibility to use OPENSSL_VERSION_NUM, but i'm not sure if there is a need to convert this to a full version string or if there is another option?
Offline
Currently, you only have OpenSslVersion and OpenSslVersionHexa globals, once the library is loaded
I have added OpenSslVersionText global variable to help:
https://github.com/synopse/mORMot2/commit/82660824
Online
Hello AB,
oh shit - what a great support!
Really appreciate your help!
i used your changes to add some other functions which are used by me and are relevant to migrate my app to mormot openssl library.
I think my changes are not 100% perfect, but can i send you my functions and is it possible to add them?
Upgrades in the future would then be easier for me.
Thanks for your support!
Offline
Hi Ab,
thank you for the possibility - will do!
But one more questions regarding the implementation:
I have one function and added this one as you did - but the difference is, that this function is new and only available in openssl 3.0.
This leads to errors when using a version beyond.
Is there a conditional loading possible (when loading openssl3XX then load this function else not?)
Really appreciate your answer!
Thanks!
Offline
In the LIB_*ENTRIES[] name lists, you can just put a ? before the name, and it won't fail if this function is not available.
Then you will have to use "if not Assigned(...) then" pattern like in the following wrapper function:
function EVP_DigestSign(ctx: PEVP_MD_CTX; sigret: PByte; var siglen: PtrUInt;
tbs: PByte; tbslen: PtrUInt): integer;
begin
if Assigned(libcrypto.EVP_DigestSign) then
// new 1.1/3.x API - as required e.g. by ED25519
result := libcrypto.EVP_DigestSign(ctx, sigret, siglen, tbs, tbslen)
else
begin
// fallback for oldest OpenSSL versions
if sigret = nil then
Online
Pages: 1