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

Code Generation DEFINE_STACK_OF() macros, and typedef STACK_OF(), TIdOpenSSLOptionsBase fix for AssignTo and Equals #5

Open
wants to merge 64 commits into
base: NewOpenSSL_PR
Choose a base branch
from

Conversation

WeberAndre
Copy link

@WeberAndre WeberAndre commented Feb 15, 2023

Code Generation for C Macros to expand DEFINE_STACK_OF() to Delphi Wrappers and some smaller bugfixes

@WeberAndre
Copy link
Author

Hi @mezen, thanks for the great work. I like to contribute these changes and fixed to your code.

Added new OpenSSL 1.1.1 header translation

Added new OpenSSL IO Handler

Fixed memory corruption

If GetPAnsiChar own created UTF8String will be freed when the method
will be leaved. In that case the string is no longer accessable for
OpenSSL.

No clue what to do with the USE_MARSHALLED_PTRS part, that has the same
problem...

Implemented more compiler macros in x509

Set default values for options

Added virtual methods for context initialization for IndySockets#224

Fixed small translation error

Fixed small errors found with FixInsight

Added missing empty implementations

Added Header to source files

Removed own definition of size_t and time_t

Added PPIdC_INT definition to fpc

Updated OpenSSL Header translation and Source Generator

Fixed quirk with circular references

Added IdOpenSSLConsts for better x64 support

Improved xml doc

Added missing include

Added some pem functions for read/write

Added translation for objects.h and fixed some other translations

Added missing includes of IdCompilerDefines.inc

Some FPC compability

Added  PPPByte to FPC

Implemented some compiler macros in crypto

Some more OpenSSL translation

Moved TIdOpenSSLPersistent to own unit

Added new TIdC_TM

Added new x509 wrapper and callback for verification

Extracted TIdOpenSSLVersion to own unit

Fixed problem with explicite TLS

Renamed tls version properties

Implemented better way for dynamic loading

Implemented usage of dynamic loading
* replaced usage of reserved words, for example &in -> in_
* removed regions
* replaced accidentally added dotted unit name in crypto

Thanks to @JedrzejczykRobert
* removed nested consts
* replaced some not existing functions
* removed regions
* replaced $Raise with Raise_

Thanks to @JedrzejczykRobert
%LINE% is a string, but we need an integer

Thanks to @grahamegrieve
rsa_st & dsa_st & dh_st & ec_key_st are already in IdOpenSSLHeaders_ossl_typ

Thanks to @grahamegrieve
* Missing cdecl
* Using PIdAnsiChar instead of PAnsiChar
With new_session_cb we tell OpenSSL that we are holding a reference to
the session. We must then also release this reference. But since we get
more than one session object we need to keep a list of them.
And when cloning an IO Handler, the session reference must be increased.

Thanks to @ralfjunker
The ssl object should be destroyed before its ssl context object.

While destroying ssl context, OpenSSL calls remove_session_cb, but our
FSessionList is already freed

Thanks to @ralfjunker
…longer

You need to set PassThrough to False

Thanks to @rlebeau
@mezen
Copy link
Owner

mezen commented Feb 21, 2023

@WeberAndre could you please rebase your code?

I already started reviewing, but Remy requested a rebase of my branch: IndySockets#299 (comment)

Code Generation for C Macros to expand DEFINE_STACK_OF() to Delphi Wrappers
prepared some code for // DEFINE_STACK_OF expansion
(moved some lines up/down)
Changed some function prototypes to use the stack_of types.
ctx is a PEVP_CIPHER_CTX and not a PEVP_MD_CTX;
The Values of   CipherSuites / UseServerCipherPreferences / AllowUnsafeLegacyRenegotiation / UseLegacyServerConnect are not compared or copied so the values set in code get never applied to the OpenSSL context
@WeberAndre
Copy link
Author

@mezen: rebase done I hope I did it right. (GIT is still not my favorite tool)

@WeberAndre WeberAndre changed the title Code Generation DEFINE_STACK_OF() macros, and typedef STACK_OF() Code Generation DEFINE_STACK_OF() macros, and typedef STACK_OF(), Fix for AssignTo and Equal Mar 27, 2023
@WeberAndre WeberAndre changed the title Code Generation DEFINE_STACK_OF() macros, and typedef STACK_OF(), Fix for AssignTo and Equal Code Generation DEFINE_STACK_OF() macros, and typedef STACK_OF(), TIdOpenSSLOptionsBase fix for AssignTo and Equals Mar 27, 2023
@zencode1 zencode1 mentioned this pull request Apr 21, 2023
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.

2 participants