Search code examples
windowsnewlisp

Error when loading crypto module on Windows


On Windows, when loading the crypto module with (module "crypto.lsp"), an error is thrown:

ERR: user error : cannot find crypto library

How to load the crypto library?


Solution

  • As documented in the module's page, it requires an openssl binary.

    Currently (winter 2018, newLISP v.10.7.1), on Windows the module looks for a gnuwin32 distribution of openssl, which is outdated (last release 2008). Trying to use it anyway doesn't work for me.

    The solution is to make your own copy of the crypto module (it's in %NEWLISPDIR%\modules) and modify it to point to your openssl's libcrypto.dll binary. In my case, I didn't actually install the whole openssl distribution, but just copied the necessary file. This is the files list in the modified crypto module:

    (set 'files '(
                  "X:/y/z/libcrypto-1_1-x64.dll" ; <<<<<<<<<<
    
                  "/usr/lib/x86_64-linux-gnu/libcrypto.so" ; Ubuntu 12.04 LTS
                  "/usr/lib/i386-linux-gnu/libcrypto.so"; Ubuntu 12.04
                  "/lib/i386-linux-gnu/libcrypto.so.1.0.0" ; UBUNTU Linux 13.04
                  "/usr/lib64/libcrypto.so" ; Fedora, CentOS 6.x
                  "/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0" ; Debian jessie
                  "/usr/lib/libcrypto.so"
                  "/usr/lib/libcrypto.so.4"
                  "/usr/lib/libcrypto.so.18.0" ; OpenBSD 4.6
                  "/usr/lib/libcrypto.so.19.0" ; OpenBSD 5.0
                  "/usr/lib/libcrypto.dylib"
                  ))