Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2010-06

OpenSSL bindings improvement

11 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Felipe Monteiro de Carvalho

Hello,

I need some functions of OpenSSL which aren't in
fpctrunk/packages/openssl/src/OpenSSL.pas

So I am adding them and I will commit after I test.

Just thought I should communicate that, in case there is already a better version, or something like that =)

thanks,

Felipe Monteiro de Carvalho

Reply by email

Leonardo M. Ramé
to Felipe Monteiro de Carvalho

Hí, I'm trying to compile FPC 2.5.1 on FreeBsd 8.0 (i386-stable). To do this, I followed the instructions from here:

http://wiki.lazarus.freepascal.org/Installing_Lazarus#Installing_Free_Pascal_under_Linux.2FBSD_manually

The probem I'm facing now is when I do an "make install" from ports, I get FPC 2.2.4, and the minimum version required to compile from trunk is 2.4.0 according to this:

How can I get 2.4.0 binary to compile the svn version?.

Leonardo M. Ramé
http://leonardorame.blogspot.com

Reply by email

Henry Vermaak
to Leonardo M. Ramé
Leonardo M. Ramé wrote 9 lines
Hí, I'm trying to compile FPC 2.5.1 on FreeBsd 8.0 (i386-stable). To do this, I followed the instructions from here: http://wiki.lazarus.freepascal.org/Installing_Lazarus#Installing_Free_Pascal_under_Linux.2FBSD_manually The probem I'm facing now is when I do an "make install" from ports, I get FPC 2.2.4, and the minimum version required to compile from trunk is 2.4.0 according to this: How can I get 2.4.0 binary to compile the svn version?.

There are some bootstrap compilers here:

ftp://ftp.freepascal.org/pub/fpc/dist/2.4.0/bootstrap/

I see there is no freebsd 8, though.

Henry

Reply by email

Leonardo M. Ramé
to Henry Vermaak

Thanks, I'll try one of them.

Leonardo M. Ramé
http://leonardorame.blogspot.com

Henry Vermaak wrote 34 lines
From: Henry Vermaak Subject: Re: [fpc-devel] FPC on Freebsd To: "FPC developers' list" Date: Friday, June 4, 2010, 9:12 AM On 4 June 2010 13:08, Leonardo M. Ramé wrote: > Hí, I'm trying to compile FPC 2.5.1 on FreeBsd 8.0 (i386-stable). To do this, I followed the instructions from here: > > http://wiki.lazarus.freepascal.org/Installing_Lazarus#Installing_Free_Pascal_under_Linux.2FBSD_manually > > The probem I'm facing now is when I do an "make install" from ports, I get FPC 2.2.4, and the minimum version required to compile from trunk is 2.4.0 according to this: > > > > How can I get 2.4.0 binary to compile the svn version?. There are some bootstrap compilers here: ftp://ftp.freepascal.org/pub/fpc/dist/2.4.0/bootstrap/ I see there is no freebsd 8, though. Henry _______________________________________________ fpc-devel maillist  -  http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Leonardo M. Ramé
to Leonardo M. Ramé

Henry, just to confirm that ppc386-freebsd-7.bz2 was able to bootstrap 2.5.1 i386 on FreeBsd 8.0

Thanks again.

Leonardo M. Ramé
http://leonardorame.blogspot.com

Leonardo M. Ramé wrote 57 lines
From: Leonardo M. Ramé Subject: Re: [fpc-devel] FPC on Freebsd To: "FPC developers' list" Date: Friday, June 4, 2010, 9:19 AM Thanks, I'll try one of them. Leonardo M. Ramé http://leonardorame.blogspot.com --- On Fri, 6/4/10, Henry Vermaak wrote: > From: Henry Vermaak > Subject: Re: [fpc-devel] FPC on Freebsd > To: "FPC developers' list" > Date: Friday, June 4, 2010, 9:12 AM > On 4 June 2010 13:08, Leonardo M. > Ramé > wrote: > > Hí, I'm trying to compile FPC 2.5.1 on FreeBsd 8.0 > (i386-stable). To do this, I followed the instructions from > here: > > > > http://wiki.lazarus.freepascal.org/Installing_Lazarus#Installing_Free_Pascal_under_Linux.2FBSD_manually > > > > The probem I'm facing now is when I do an "make > install" from ports, I get FPC 2.2.4, and the minimum > version required to compile from trunk is 2.4.0 according to > this: > > > > > > > > How can I get 2.4.0 binary to compile the svn > version?. > > There are some bootstrap compilers here: > > ftp://ftp.freepascal.org/pub/fpc/dist/2.4.0/bootstrap/ > > I see there is no freebsd 8, though. > > Henry > _______________________________________________ > fpc-devel maillist  -  > http://lists.freepascal.org/mailman/listinfo/fpc-devel > _______________________________________________ fpc-devel maillist  -  http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Marco van de Voort
to Henry Vermaak: There are some bootstrap compilers here: ftp://ftp.freepascal.org/pub/fpc/dist/2.4.0/boots…

In our previous episode, Henry Vermaak said:

Show quoted text 8 lines
> > How can I get 2.4.0 binary to compile the svn version?. There are some bootstrap compilers here: ftp://ftp.freepascal.org/pub/fpc/dist/2.4.0/bootstrap/ I see there is no freebsd 8, though.

The bootstrap compilers are statically linked, so iirc they work even when no COMPAT_ is installed.

Reply by email

Inoussa OUEDRAOGO
to Felipe Monteiro de Carvalho: I need some functions of OpenSSL which aren't in fpctrunk/packages/openssl/src/OpenSSL.pas

Hi

2010/6/2 Felipe Monteiro de Carvalho :

Show quoted text 6 lines
Hello, I need some functions of OpenSSL which aren't in fpctrunk/packages/openssl/src/OpenSSL.pas So I am adding them and I will commit after I test.

I just start adding RSA parts and making it Delphi compatible. What about your porgress ?

Best regards.

Inoussa O.

Reply by email

Felipe Monteiro de Carvalho
to Inoussa OUEDRAOGO

Hello,

I just commited my changes, because otherwise our work would conflict. Please work on top of this new version.

I checked a lot of functions against OpenSSL 1.0.0 and it attested that they work fine. I added many structures and in added a mechanism to display which routines couldn't be found in the library. This can be useful because of the plethora of OpenSSL versions available which may not have all functions.

In terms of functions I removed some functions which don't exist in v1.0.0 and added the following:

+  // RAND functions
+  TRAND_set_rand_method = function(const meth: PRAND_METHOD): cint; cdecl;
+  TRAND_get_rand_method = function(): PRAND_METHOD; cdecl;
+  TRAND_SSLeay = function(): PRAND_METHOD; cdecl;
+  TRAND_cleanup = procedure(); cdecl;
+  TRAND_bytes = function(buf: PByte; num: cint): cint; cdecl;
+  TRAND_pseudo_bytes = function(buf: PByte; num: cint): cint; cdecl;
+  TRAND_seed = procedure(const buf: Pointer; num: cint); cdecl;
+  TRAND_add = procedure(const buf: Pointer; num: cint; entropy:
cdouble); cdecl;
+  TRAND_load_file = function(const file_name: PChar; max_bytes:
clong): cint; cdecl;
+  TRAND_write_file = function(const file_name: PChar): cint; cdecl;
+  TRAND_file_name = function(file_name: PChar; num: csize_t): PChar; cdecl;
+  TRAND_status = function(): cint; cdecl;
+  TRAND_query_egd_bytes = function(const path: PChar; buf: PByte;
bytes: cint): cint; cdecl;
+  TRAND_egd = function(const path: PChar): cint; cdecl;
+  TRAND_egd_bytes = function(const path: PChar; bytes: cint): cint; cdecl;
+  TERR_load_RAND_strings = procedure(); cdecl;
+  TRAND_poll = function(): cint; cdecl;
+
+  // RSA Functions
+  TRSA_new = function (): PRSA; cdecl;
+  TRSA_new_method = function (method: PENGINE): PRSA; cdecl;
+  TRSA_size = function (arsa: PRSA): cint; cdecl;
+  TRsaGenerateKey = function(bits, e: cInt; callback: PFunction;
cb_arg: SslPtr): PRSA; cdecl;
+  TRSA_generate_key_ex = function (arsa: PRSA; bits: cInt; e:
PBIGNUM; cb: PBN_GENCB): PRSA; cdecl;
+  TRSA_check_key = function (arsa: PRSA): cint; cdecl;
+  TRSA_public_encrypt = function (flen: cint; from_buf, to_buf:
PByte; arsa: PRSA; padding: cint): cint; cdecl;
+  TRSA_private_encrypt = function (flen: cint; from_buf, to_buf:
PByte; arsa: PRSA; padding: cint): cint; cdecl;
+  TRSA_public_decrypt = function (flen: cint; from_buf, to_buf:
PByte; arsa: PRSA; padding: cint): cint; cdecl;
+  TRSA_private_decrypt = function (flen: cint; from_buf, to_buf:
PByte; arsa: PRSA; padding: cint): cint; cdecl;
+  TRSA_free = procedure (arsa: PRSA); cdecl;
+  TRSA_flags = function (arsa: PRSA): Integer; cdecl;
+  TRSA_set_default_method = procedure (method: PRSA_METHOD); cdecl;
+  TRSA_get_default_method = function : PRSA_METHOD; cdecl;
+  TRSA_get_method = function (prsa: PRSA): PRSA_METHOD; cdecl;
+  TRSA_set_method = function (arsa: PRSA; method: PRSA_METHOD):
PRSA_METHOD; cdecl;
+
+  // X509 Functions
+
+  Td2i_RSAPublicKey = function (arsa: PPRSA; pp: PPByte; len: cint):
PRSA; cdecl;
+  Ti2d_RSAPublicKey = function (arsa: PRSA; pp: PPByte): cint; cdecl;
+  Td2i_RSAPrivateKey = function (arsa: PPRSA; pp: PPByte; len: cint):
PRSA; cdecl;
+  Ti2d_RSAPrivateKey = function (arsa: PRSA; pp: PPByte): cint; cdecl;
+
+  // ERR Functions
+
+  TErr_Error_String = function (e: cInt; buf: PChar): PChar; cdecl;
+
+  // Crypto Functions
+
+  TSSLeay_version = function(t: cint): PChar; cdecl;
+
+  // EVP Functions
+
+  TOpenSSL_add_all_algorithms = procedure(); cdecl;
+  TOpenSSL_add_all_ciphers = procedure(); cdecl;
+  TOpenSSL_add_all_digests = procedure(); cdecl;
+  //
+  TEVP_DigestInit = function(ctx: PEVP_MD_CTX; type_: PEVP_MD): cint; cdecl;
+  TEVP_DigestUpdate = function(ctx: PEVP_MD_CTX; const data: Pointer;
cnt: csize_t): cint; cdecl;
+  TEVP_DigestFinal = function(ctx: PEVP_MD_CTX; md: PByte; s:
pcuint): cint; cdecl;
+  //
+  TEVP_get_cipherbyname = function(const name: PChar): PEVP_CIPHER; cdecl;
+  TEVP_get_digestbyname = function(const name: PChar): PEVP_MD; cdecl;
+  //
+  TEVP_CIPHER_CTX_init = procedure(a: PEVP_CIPHER_CTX); cdecl;
+  TEVP_CIPHER_CTX_cleanup = function(a: PEVP_CIPHER_CTX): cint; cdecl;
+  TEVP_CIPHER_CTX_set_key_length = function(x: PEVP_CIPHER_CTX;
keylen: cint): cint; cdecl;
+  TEVP_CIPHER_CTX_ctrl = function(ctx: PEVP_CIPHER_CTX; type_, arg:
cint; ptr: Pointer): cint; cdecl;
+  //
+  TEVP_EncryptInit = function(ctx: PEVP_CIPHER_CTX; const chipher_:
PEVP_CIPHER;
+           const key, iv: PByte): cint; cdecl;
+  TEVP_EncryptUpdate = function(ctx: PEVP_CIPHER_CTX; out_: pcuchar;
+           outlen: pcint; const in_: pcuchar; inlen: cint): cint; cdecl;
+  TEVP_EncryptFinal = function(ctx: PEVP_CIPHER_CTX; out_data: PByte;
outlen: pcint): cint; cdecl;
+  //
+  TEVP_DecryptInit = function(ctx: PEVP_CIPHER_CTX; chiphir_type: PEVP_CIPHER;
+           const key, iv: PByte): cint; cdecl;
+  TEVP_DecryptUpdate = function(ctx: PEVP_CIPHER_CTX; out_data: PByte;
+           outl: pcint; const in_: PByte; inl: cint): cint; cdecl;
+  TEVP_DecryptFinal = function(ctx: PEVP_CIPHER_CTX; outm: PByte;
outlen: pcint): cint; cdecl;

thanks,

Felipe Monteiro de Carvalho

Reply by email

Inoussa OUEDRAOGO
to Felipe Monteiro de Carvalho

2010/6/21 Felipe Monteiro de Carvalho :

Hello, I just commited my changes, because otherwise our work would conflict. Please work on top of this new version.

Your changes include mostly mine. I will check the Delphi compatibility ( ctypes.pp has to be modified ).

Thanks.

Inoussa O.

Reply by email