crunchbang crypto library and sqlite3

Started by jazper, December 01, 2013, 05:14:44 AM

Previous topic - Next topic

jazper

While trying to use sqlite3 in an app that needs the crypto library, I get a warning "can't find crypto library".  On Crunchbang linux, there are a few "crypt" files in /usr/lib/x86_64-linux-gnu directory:

libcrypt.so,

libcrypt.so.1.0.0,

libcrypt.a

the first is a symlink, as follows:lrwxrwxrwx   1 root root       35 Aug 18 14:19 libcrypt.so -> /lib/x86_64-linux-gnu/libcrypt.so.1

The problem is, I can't find the file the symlink points to (libcrypt.so.1), certainly not on that folder.  Should I edit the link to point to libcrypt.so.1.0.0?

TedWalther

#1
Sure, give it a try.
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

rickyboy

#2
Are you SURE that file doesn't exist?  Notice that the link points to a file in the directory "/lib/x86_64-linux-gnu", NOT "/usr/lib/x86_64-linux-gnu" (which is a different directory).



I think the problem is that some newLISP app code is calling out the module crypto.lsp, and crypto.lsp is looking in the wrong place for your crypto library.  Check out the definition of the list files in the module code.



It looks like the OpenSSL crypto library always gets plopped into the directory /usr/lib/x86_64-linux-gnu/ on 64-bit Linux systems (e.g. that's the way it is on my old Ubuntu server too).  If so, then the string "/usr/lib/x86_64-linux-gnu/libcrypto.so" needs to be added into the definition of the list files in newlisp/modules/crypto.lsp.



This is the definition of files that I have now, corresponding to newLISP 10.5.4 (which clearly doesn't look in /usr/lib/x86_64-linux-gnu for libcrypto).


(set 'files '(
    "C:/Program Files/gnuwin32/bin/libeay32.dll" ; XP
    "C:/Program Files (x86)/gnuwin32/bin/libeay32.dll" ; 7
    "/usr/lib/libcrypto.so"
    "/usr/lib/libcrypto.so.0.9.8"
    "/usr/lib/libcrypto.so.0.9.7"
    "/usr/lib/libcrypto.so.0.9.6"
    "/usr/lib/libcrypto.so.4"
    "/usr/lib/libcrypto.so.18.0" ; OpenBSD 4.6
    "/usr/lib/libcrypto.dylib"
))

Hope that helps.
(λx. x x) (λx. x x)

rickyboy

#3
BTW, libcrypto and libcrypt are two different animals.  libcrypto is probably what you (or more correctly, crypto.lsp) want(s).



(In this case, one little "o" makes a big difference. :)
(λx. x x) (λx. x x)

jazper

#4
Late, late into the small hours, everything came right.  



I can't recall what I did, unfortunately, because on checking what steps I'd written down, it's obvious I left stuff out.  



But thanks very much for all the pointers.  They ring bells, so they are pretty much what I must have discovered along the way myself.  I'm going to need to do this again at some stage, though, so what you have set out for me is really valuable.  My own paper trail was dogged by fatigue!

jazper

#5
What I can say is that /usr/lib, on my 64 bit Crunchbang system, has no files named "librypt" anything at all.



I think my biggest problem was that I was editing the wrong file list, ie. inserting the crypto file names into the file list in sqlite3.lsp, instead of the file list in crypto.lsp.  Both lists look similar, and I just found myself in the wrong file with the wrong file list.  Here's what I have now, and it did the trick (I removed the SymLink):
(set 'files '(
    "C:/Program Files/gnuwin32/bin/libeay32.dll" ; XP
    "C:/Program Files (x86)/gnuwin32/bin/libeay32.dll" ; 7
    "/usr/lib/libcrypto.so"
    "/usr/lib/libcrypto.so.0.9.8"
    "/usr/lib/libcrypto.so.0.9.7"
    "/usr/lib/libcrypto.so.0.9.6"
    "/usr/lib/libcrypto.so.4"
    "/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0"
    "/usr/lib/libcrypto.so.18.0" ; OpenBSD 4.6
    "/usr/lib/libcrypto.dylib"
))


Having tried to put this file into the list in sqlite3.lsp would have produced the error, because that list is for the sqlite3 files, which weren't even looking for crypto files.  Such is the way of bloodshot eyed, late night stuff.



Please accept my apologies for this daft misdirection (if that's what it was) :(

jazper

#6
Thanks, Rickyboy.  After a closer look, I did find "libcrypt" files in /lib/x86_64-linux-gnu, but I do not have any "libcrypto" files in /lib/x86_64-linux-gnu.