some functions are from libcrypto, not libssl

svn: r2814
This commit is contained in:
Matthew Flatt 2006-04-27 15:55:27 +00:00
parent 70ee0daf0a
commit 370a2dd689
2 changed files with 32 additions and 32 deletions

View File

@ -12,8 +12,8 @@ machine, but
* for Mac OS X, version 10.2 and later provides the necessary OpenSSL * for Mac OS X, version 10.2 and later provides the necessary OpenSSL
libraries. libraries.
* for Unix, libssl.so is likely to be installed on your machine * for Unix, libssl.so and libcryto.so are likely to be installed on
already. your machine, already.
================================================== ==================================================
@ -246,15 +246,15 @@ identifies itself using "test.pem".
Implementation notes Implementation notes
-------------------- --------------------
For Windows, "mzssl.ss" relies on "libeay32xxxxxxxx.dll" and For Windows, "mzssl.ss" relies on "libeay32.dll" and "ssleay32.dll",
"ssleay32xxxxxxxx.dll", where the "xxxxxxxx" may be replaced with a where the DLLs are located in the same place as "libmzsch<VERS>.dll"
PLT Scheme verison number, and where the DLLs are located in the same (where <VERS> is either "xxxxxxx" or a mangling of MzScheme's version
place as "libmzschxxxxxxx.dll". The DLLs are distributed as part of number). The DLLs are distributed as part of PLT Scheme.
PLT Scheme.
For Unix variants, "mzssl.ss" relies on "libssl.so", which must be For Unix variants, "mzssl.ss" relies on "libcryto.so" and "libssl.so",
installed in a standard library location, or in a directory listed by which must be installed in a standard library location, or in a
LD_LIBRARY_PATH. directory listed by LD_LIBRARY_PATH.
For Mac OS X, "mzssl.ss" relies on "libssl.dylib", which is part of For Mac OS X, "mzssl.ss" relies on "libssl.dylib" and
the OS distribution for Mac OS X 10.2 and later. "libcryto.dylib", which are part of the OS distribution for Mac OS X
10.2 and later.

View File

@ -82,7 +82,7 @@
(define 3m? (regexp-match #rx#"3m" (path->bytes (system-library-subpath)))) (define 3m? (regexp-match #rx#"3m" (path->bytes (system-library-subpath))))
(define libeay (define libcrypto
(with-handlers ([exn:fail? (lambda (x) (with-handlers ([exn:fail? (lambda (x)
(set! ssl-load-fail-reason (exn-message x)) (set! ssl-load-fail-reason (exn-message x))
#f)]) #f)])
@ -90,18 +90,18 @@
[(windows) [(windows)
(ffi-lib-win "libeay32")] (ffi-lib-win "libeay32")]
[else [else
(ffi-lib "libssl")]))) (ffi-lib "libcrypto")])))
(define libssl (define libssl
(with-handlers ([exn:fail? (lambda (x) (and libcrypto
(set! ssl-load-fail-reason (exn-message x)) (with-handlers ([exn:fail? (lambda (x)
#f)]) (set! ssl-load-fail-reason (exn-message x))
(case (system-type) #f)])
[(windows) (case (system-type)
(and libeay [(windows)
(ffi-lib-win "ssleay32"))] (ffi-lib-win "ssleay32")]
[else [else
libeay]))) (ffi-lib "libssl")]))))
(define libmz (define libmz
(case (system-type) (case (system-type)
@ -124,7 +124,7 @@
(get-ffi-obj str lib (_fun . type)) (get-ffi-obj str lib (_fun . type))
(lambda args (raise-not-available)))))]))])) (lambda args (raise-not-available)))))]))]))
(define-define-X define-eay libeay libeay) (define-define-X define-crypto libcrypto libcrypto)
(define-define-X define-ssl libssl libssl) (define-define-X define-ssl libssl libssl)
(define-define-X define-mzscheme #t libmz) (define-define-X define-mzscheme #t libmz)
@ -149,13 +149,13 @@
(define-ssl TLSv1_client_method (-> _SSL_METHOD*)) (define-ssl TLSv1_client_method (-> _SSL_METHOD*))
(define-ssl TLSv1_server_method (-> _SSL_METHOD*)) (define-ssl TLSv1_server_method (-> _SSL_METHOD*))
(define-eay BIO_s_mem (-> _BIO_METHOD*)) (define-crypto BIO_s_mem (-> _BIO_METHOD*))
(define-eay BIO_new (_BIO_METHOD* -> _BIO*)) (define-crypto BIO_new (_BIO_METHOD* -> _BIO*))
(define-eay BIO_free (_BIO* -> _void)) (define-crypto BIO_free (_BIO* -> _void))
(define-eay BIO_read (_BIO* _bytes _int -> _int)) (define-crypto BIO_read (_BIO* _bytes _int -> _int))
(define-eay BIO_write (_BIO* _bytes _int -> _int)) (define-crypto BIO_write (_BIO* _bytes _int -> _int))
(define-eay BIO_ctrl (_BIO* _int _long _long -> _long)) (define-crypto BIO_ctrl (_BIO* _int _long _long -> _long))
(define (BIO_set_mem_eof_return b v) (define (BIO_set_mem_eof_return b v)
(BIO_ctrl b BIO_C_SET_BUF_MEM_EOF_RETURN v 0)) (BIO_ctrl b BIO_C_SET_BUF_MEM_EOF_RETURN v 0))
@ -184,8 +184,8 @@
(define-ssl SSL_get_error (_SSL* _int -> _int)) (define-ssl SSL_get_error (_SSL* _int -> _int))
(define-eay ERR_get_error (-> _long)) (define-crypto ERR_get_error (-> _long))
(define-eay ERR_error_string_n (_long _bytes _long -> _void)) (define-crypto ERR_error_string_n (_long _bytes _long -> _void))
(define-ssl SSL_library_init (-> _void)) (define-ssl SSL_library_init (-> _void))
(define-ssl SSL_load_error_strings (-> _void)) (define-ssl SSL_load_error_strings (-> _void))