Recently Written · git

clic

MIRROR ONLY Gopher client with pretty colours in Common Lisp

git clone https://github.com/equwal/clic

Log | Files | Refs


3rdparties/software/cl+ssl-20200427-git/src/reload.lisp (4230 bytes)

1 ;;;; -*- Mode: LISP; Syntax: COMMON-LISP; indent-tabs-mode: nil; coding: utf-8; show-trailing-whitespace: t -*-
2 ;;;
3 ;;; Copyright (C) 2001, 2003  Eric Marsden
4 ;;; Copyright (C) 2005  David Lichteblau
5 ;;; "the conditions and ENSURE-SSL-FUNCALL are by Jochen Schmidt."
6 ;;;
7 ;;; See LICENSE for details.
8 
9 ;;; We do this in an extra file so that it happens
10 ;;;   - after the asd file has been loaded, so that users can
11 ;;;     customize *libssl-pathname* between loading the asd and LOAD-OPing
12 ;;;     the actual sources
13 ;;;   - before ssl.lisp is loaded, which needs the library at compilation
14 ;;;     time on some implemenations
15 ;;;   - but not every time ffi.lisp is re-loaded as would happen if we
16 ;;;     put this directly into ffi.lisp
17 
18 #+xcvb (module (:depends-on ("package")))
19 
20 (in-package :cl+ssl)
21 
22 
23 
24 ;; Windows builds have been naming librypto and libssl DLLs in several different ways:
25 ;;
26 ;; - libeay32.dll, libssl32.dll
27 ;; - libeay32.dll, ssleay32.dll
28 ;;
29 ;; Note, the above names were used both for 32 and 64 -bit versions.
30 ;;
31 ;; - libcrypto-1_1-x64.dll, libssl-1_1-x64.dll
32 ;;
33 ;; The above are used for 64-bit only.
34 ;;
35 ;; - libcrypto-1_1.dll, libssl-1_1.dll
36 ;;
37 ;; These are 32-bit only.
38 
39 (cffi:define-foreign-library libcrypto
40   (:windows (:or #+(and windows x86-64) "libcrypto-1_1-x64.dll"
41                  #+(and windows x86) "libcrypto-1_1.dll"
42                  "libeay32.dll"))
43   (:openbsd "libcrypto.so")
44   (:darwin (:or "/opt/local/lib/libcrypto.dylib" ;; MacPorts
45                 "/sw/lib/libcrypto.dylib"        ;; Fink
46                 "/usr/local/opt/openssl/lib/libcrypto.dylib" ;; Homebrew
47                 "/usr/local/lib/libcrypto.dylib" ;; personalized install
48                 "libcrypto.dylib"                ;; default system libcrypto, which may have insufficient crypto
49                 "/usr/lib/libcrypto.dylib"))
50   (:cygwin (:or "cygcrypto-1.1.dll" "cygcrypto-1.0.0.dll")))
51 
52 (cffi:define-foreign-library libssl
53   (:windows (:or #+(and windows x86-64) "libssl-1_1-x64.dll"
54                  #+(and windows x86) "libssl-1_1.dll"
55                  "libssl32.dll"
56                  "ssleay32.dll"))
57   ;; The default OS-X libssl seems have had insufficient crypto algos
58   ;; (missing TLSv1_[1,2]_XXX methods,
59   ;; see https://github.com/cl-plus-ssl/cl-plus-ssl/issues/56)
60   ;; so first try to load possible custom installations of libssl
61   (:darwin (:or "/opt/local/lib/libssl.dylib" ;; MacPorts
62                 "/sw/lib/libssl.dylib"        ;; Fink
63                 "/usr/local/opt/openssl/lib/libssl.dylib" ;; Homebrew
64                 "/usr/local/lib/libssl.dylib" ;; personalized install
65                 "libssl.dylib"                ;; default system libssl, which may have insufficient crypto
66                 "/usr/lib/libssl.dylib"))
67   (:solaris (:or "/lib/64/libssl.so"
68                  "libssl.so.0.9.8" "libssl.so" "libssl.so.4"))
69   ;; Unlike some other systems, OpenBSD linker,
70   ;; when passed library name without versions at the end,
71   ;; will locate the library with highest macro.minor version,
72   ;; so we can just use just "libssl.so".
73   ;; More info at https://github.com/cl-plus-ssl/cl-plus-ssl/pull/2.
74   (:openbsd "libssl.so")
75   ((and :unix (not :cygwin)) (:or "libssl.so.1.1"
76                                   "libssl.so.1.0.2m"
77                                   "libssl.so.1.0.2k"
78                                   "libssl.so.1.0.2"
79                                   "libssl.so.1.0.1l"
80                                   "libssl.so.1.0.1j"
81                                   "libssl.so.1.0.1f"
82                                   "libssl.so.1.0.1e"
83                                   "libssl.so.1.0.1"
84                                   "libssl.so.1.0.0q"
85                                   "libssl.so.1.0.0"
86                                   "libssl.so.0.9.8ze"
87                                   "libssl.so.0.9.8"
88                                   "libssl.so.10"
89                                   "libssl.so.4"
90                                   "libssl.so"))
91   (:cygwin (:or "cygssl-1.1.dll" "cygssl-1.0.0.dll"))
92   (t (:default "libssl3")))
93 
94 (unless (member :cl+ssl-foreign-libs-already-loaded
95                 *features*)
96   (cffi:use-foreign-library libcrypto)
97   (cffi:use-foreign-library libssl))