Recent

Author Topic: sFTP session example  (Read 18330 times)

rvk

  • Hero Member
  • *****
  • Posts: 6169
Re: sFTP session example
« Reply #15 on: May 20, 2015, 11:20:30 am »
I guess you meant: sudo apt-get install libcrypt*
(asterisk connected to libcrypt :))

I had to remove Windows from the uses-clause in ssl_cryptlib.
After that I got:
Code: [Select]
/usr/bin/ld: cannot find -lcl

That's because Lazarus can't find the library libcl.so.
(B.T.W. It's not LCL but Library "lc" which it can't find).

From the source of cryptlib.pas:
Quote
  cryptlibname = 'libcl.so';  { library name for Unix/Linux  (Kylix) }
                 { symbolic link should be used for libcl.so -> libcl.so.3.x.y }     

I'm not sure where you need to get the libcl.so.3.x.y from.
(you might need to compile it from source cl343_beta.zip)

Edit: Yeah. There is probably no ready compiled cryptlib package for Debian (so go ahead and compile one yourself).
http://comments.gmane.org/gmane.comp.encryption.cryptlib/2529
« Last Edit: May 20, 2015, 11:33:17 am by rvk »

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: sFTP session example
« Reply #16 on: May 20, 2015, 11:53:59 am »
Thank you  :)

Alternative idea for sftp connection?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

rvk

  • Hero Member
  • *****
  • Posts: 6169
Re: sFTP session example
« Reply #17 on: May 20, 2015, 02:59:49 pm »
Alternative idea for sftp connection?
You could try converting the SimpleSFTP.pas to openssl but I'm not sure that's going to work.

But what's the trouble with downloading CL343_Beta.zip from here and compiling it yourself.

Make sure you use unzip -a (-a is for converting DOS-line endings to Linux-line endings)

In Downloads
Code: [Select]
unzip -a -d cryptlib cl343_beta.zip
cd cryptlib
make shared
sudo cp libcl.so.3.4.3 /usr/lib
sudo ln -s /usr/lib/libcl.so.3.4.3 /usr/lib/libcl.so
You now have a libcl.so (symbolic link to /usr/lib/libcl.so.3.4.3) and your program will compile perfectly.

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: sFTP session example
« Reply #18 on: May 20, 2015, 03:30:20 pm »
The problem is that I have to use it for a program that must be redistributed for fee
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

rvk

  • Hero Member
  • *****
  • Posts: 6169
Re: sFTP session example
« Reply #19 on: May 21, 2015, 11:11:51 am »
The problem is that I have to use it for a program that must be redistributed for fee
Maybe you can find out if libssh2 is freely distributable.

I'm not sure if it's going to work but you could try using TSSLLibSSH2 instead of TSSLCryptLib in SimpleSFTP. But before trying, you need to make sure you can use libssh2.

libssh2 should be able to do sftp. See here. So maybe with some minor adjustments it could be made to work with SimpleSFTP (hopefully).

From Synapse:
Quote
//requires LibSSH2 libraries! http://libssh2.org

{:@abstract(SSH plugin for LibSSH2)

Requires libssh2.dll or libssh2.so.
You can download binaries as part of the CURL project from
http://curl.haxx.se/download.html

You need Pascal bindings for the library too! You can find one at:
 http://www.lazarus.freepascal.org/index.php/topic,15935.msg86465.html#msg86465

(Edit: I can confirm libssh2 does sftp correctly. You need to check yourself if you may distribute it freely)
« Last Edit: May 21, 2015, 04:24:17 pm by rvk »

 

TinyPortal © 2005-2018