Recent

Author Topic: The Pascal API for OpenSSL  (Read 360 times)

tonyw

  • Sr. Member
  • ****
  • Posts: 359
    • MWA Software
The Pascal API for OpenSSL
« on: May 22, 2026, 02:14:45 pm »
MWA Software is pleased to announce a major upgrade to the PascalAPI4OpenSSL package.

This is available from https://github.com/MWASoftware/PascalAPI4OpenSSL

This repository provides Pascal Interfaces to the OpenSSL API for the current versions of the
OpenSSL library. (3.0.20, 3.5.6, 3.6.2 and 4.0.0). 3.0.20 is also available with a legacy
support option; this adds backwards compatibility for OpenSSL 1.0.2 and 1.1.0 core functionality.

The Pascal API is intended to work with both FPC and Delphi.

OpenSSL is itself an open source code library providing an implementation that includes
the RFC 8446 Transport Layer Security (TLS) Protocol Version 1.3. (see https://www.openssl.org/).

The OpenSSL API may be used to support many applications including:

  * secure (https) webserver access
  * secure transport connections
  * X.509 certificate management, and
  * General purpose encryption/decryption for many different ciphers.

The OpenSSL library is written in 'C' and the programmatic interface is defined in a series of
'C' header files. These have been translated into Pascal units in order to make available the interface
to a Pascal program. The PascalAPI4OpenSSL package provides a Pascal API to the OpenSSL libraries.

The OpenSSL API is large (Release 4.0.0 contains 145 headers files), making manual translation infeasible.
This translation is machine driven and is as complete as possible. The main omissions are macros
that cannot be readily translated. These are typically macros that check variable types. Given
that Pascal is already strongly typed, these macros are redundant. Otherwise, some of the more
complex macros are not yet processable by this version of the generator. Note the "stack" macros
are fully translated.

The translator is itself a major upgrade on the venerable h2pas utility and is also available for general use
at https://github.com/MWASoftware/h2pasng.

The IndySecOpenSSL package (https://github.com/MWASoftware/IndySecOpenSSL) provides example
use cases for the OpenSSL headers supporting secure https communication.

The main branch of IndySecOpenSSL is equivalent to the previous release and is based on the OpenSSL 3.0.20 headers with
legacy support for OpenSSL 1.0.2 and 1.1.0. This will eventually replace the OPM IndySecOpenSSL
package. Other branches of IndySecOpenSSL are also available each using a different release of the
OpenSSL headers.

devEric69

  • Hero Member
  • *****
  • Posts: 657
Re: The Pascal API for OpenSSL
« Reply #1 on: May 26, 2026, 03:28:54 pm »
> https://github.com/MWASoftware/h2pasng

Thank you! Upgrading such a hybrid interpreter, based on the parsing of two ‘cousins’ grammar but not so easy to translate (the pointers, the nesting of types within one another involving recursion, …) (without a graphical interface to display the glyphs identified and then interpreted, is indeed a rather austere task, AMHO) opens up significant opportunities through the integration of the APIs written in C into fp, APIs which are often already very well written and maintained since a long time ago.

A fan of IBX for Lazarus.
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

 

TinyPortal © 2005-2018