#1 2024-04-23 14:09:47

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 337

Identifiers redeclared when OPENSSLFULLAPI is defined

Hi, using mormot.crypt.openssl.pas and mormot.lib.openssl11.pas with OPENSSLFULLAPI enabled and compiling too much errors Identifier redeclared: 'NID_info_access' and similars are raised. I commented on the redeclared.

UPDATE:

Missing record definition in mormot.lib.openssl11.full.inc

  x509_val_st = record
    notBefore: PASN1_TIME;
    notAfter: PASN1_TIME;
  end;

UPDATE 1:
In mormot.lib.openssl11.pas the OPENSSLSTATIC is not defined if OPENSSLFULLAPI is defined.

const
  // some binaries may be retrieved from https://github.com/grijjy/DelphiOpenSsl
  // or http://wiki.overbyte.eu/wiki/index.php/ICS_Download (more up-to-date)
  // - on Windows, we found out that ICS OpenSSL 3 is slower than OpenSSL 1.1
  {$ifdef OSWINDOWS}
    {$ifdef CPU32}
    LIB_CRYPTO1 = 'libcrypto-1_1.dll';
    LIB_SSL1 = 'libssl-1_1.dll';
    LIB_CRYPTO3 = 'libcrypto-3.dll';
    LIB_SSL3 = 'libssl-3.dll';
    _PU = '';
    {$else}
    LIB_CRYPTO1 = 'libcrypto-1_1-x64.dll';
    LIB_SSL1 = 'libssl-1_1-x64.dll';
    LIB_CRYPTO3 = 'libcrypto-3-x64.dll';
    LIB_SSL3 = 'libssl-3-x64.dll';
    _PU = '';
    {$endif CPU32}
    {$ifdef OPENSSLFULLAPI}     // 
      {$define OPENSSLSTATIC}  // with this is working
    {$ENDIF OPENSSLFULLAPI}  //
  {$else}
  ...

UPDATE 2: in mormot.lib.openssl11.inc close bracket is in wrong position.

//function BIO_meth_get_write(p1: PBIO; p2: PUTF8Char; p3: Integer; biom: PBIO_METHOD): integer;
{ TODO : Cannot convert original type "int (*)(BIO *, const char *, int)" }; cdecl; //HERE
//  external LIB_CRYPTO name _PU + 'BIO_meth_get_write';

//function BIO_meth_get_write_ex(p1: PBIO; p2: PUTF8Char; p3: PtrUIntp4: PPtrUInt; biom: PBIO_METHOD): integer;
{ TODO : Cannot convert original type "int (*)(BIO *, const char *, size_t, size_t *)" }; cdecl; //HERE
//  external LIB_CRYPTO name _PU + 'BIO_meth_get_write_ex';

Commented with

//TODO: Cannot convert original ...

are with close bracket in wrong position.

There is much more compiler errors.

Thanks.

Last edited by EMartin (2024-04-23 15:14:07)


Esteban

Offline

#2 2024-04-23 16:24:20

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Identifiers redeclared when OPENSSLFULLAPI is defined

OPENSSLFULLAPI is currently not supported nor tested. It is only a source code place holder for future addition of missing APIs.

If you are missing some API entries, create Pull Requests on the project with them.
But look first if you already can't use the existing APIs, or even better the existing high-level wrappers.

And do not ask for pre-OpenSSL low-level 3.0 APIs, I doubt we would include those legacy calls and types.
We try to stick to the official https://www.openssl.org/docs/man3.0/man … Level-APIs guidelines.
Those low-level APIs will eventually completely disappear in a future revision of OpenSSL.

And I would not use https://github.com/grijjy/DelphiOpenSsl on production any more, because their static binaries are not updated, and are clearly in a deprecated and unsafe version of OpenSSL.
Perhaps we will fully get rid of compatibility with grijjy statics.

Offline

Board footer

Powered by FluxBB