 |
Changeset 4298
- Timestamp:
- 01/28/09 10:00:11
(3 years ago)
- Author:
- fawzi
- Message:
making OpenSSL work on mac 10.5, using c_ulong (plus comment about to do for using it more consistently) fix #1349
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r4188 |
r4298 |
|
| 15 | 15 | private import tango.stdc.stdio; |
|---|
| 16 | 16 | private import tango.stdc.stringz; |
|---|
| | 17 | private import tango.stdc.config: c_long,c_ulong; |
|---|
| 17 | 18 | |
|---|
| 18 | 19 | private import tango.io.Stdout; |
|---|
| … | … | |
| 38 | 39 | |
|---|
| 39 | 40 | These will need to be reversed to support 64bit tango |
|---|
| | 41 | (should use c_long and c_ulong from tango.stdc.config) |
|---|
| 40 | 42 | |
|---|
| 41 | 43 | XXX TODO XXX |
|---|
| … | … | |
| 135 | 137 | void *ap_data; |
|---|
| 136 | 138 | int key_len; |
|---|
| 137 | | version (X86_64) |
|---|
| 138 | | ulong flags; |
|---|
| 139 | | else |
|---|
| 140 | | uint flags; |
|---|
| | 139 | c_ulong flags; |
|---|
| 141 | 140 | void *cipher_data; |
|---|
| 142 | 141 | int final_used; |
|---|
| … | … | |
| 144 | 143 | ubyte[EVP_MAX_BLOCK_LENGTH] finalv; |
|---|
| 145 | 144 | }; |
|---|
| | 145 | |
|---|
| | 146 | // fallback for OpenSSL 0.9.7l 28 Sep 2006 that defines only macros |
|---|
| | 147 | int EVP_CIPHER_CTX_block_size_097l(EVP_CIPHER_CTX *e){ |
|---|
| | 148 | return *((cast(int*)e.cipher)+1); |
|---|
| | 149 | } |
|---|
| 146 | 150 | |
|---|
| 147 | 151 | struct BIO |
|---|
| … | … | |
| 630 | 634 | static SharedLib eaylib = null; |
|---|
| 631 | 635 | } |
|---|
| | 636 | version(darwin){ |
|---|
| | 637 | static SharedLib cryptolib = null; |
|---|
| | 638 | } |
|---|
| 632 | 639 | static ReadWriteMutex[] _locks = null; |
|---|
| 633 | 640 | |
|---|
| … | … | |
| 836 | 843 | bindFunc(EVP_DecryptFinal_ex, "EVP_DecryptFinal_ex", ssllib); |
|---|
| 837 | 844 | bindFunc(EVP_aes_128_cbc, "EVP_aes_128_cbc", ssllib); |
|---|
| 838 | | bindFunc(EVP_CIPHER_CTX_block_size, "EVP_CIPHER_CTX_block_size", ssllib); |
|---|
| | 845 | try { |
|---|
| | 846 | bindFunc(EVP_CIPHER_CTX_block_size, "EVP_CIPHER_CTX_block_size", ssllib); |
|---|
| | 847 | } catch (Exception e){ |
|---|
| | 848 | // openSSL 0.9.7l defines only macros, not the function |
|---|
| | 849 | EVP_CIPHER_CTX_block_size=&EVP_CIPHER_CTX_block_size_097l; |
|---|
| | 850 | } |
|---|
| 839 | 851 | bindFunc(EVP_CIPHER_CTX_cleanup, "EVP_CIPHER_CTX_cleanup", ssllib); |
|---|
| 840 | 852 | } |
|---|
| … | … | |
| 881 | 893 | version(Posix) |
|---|
| 882 | 894 | { |
|---|
| 883 | | bindCrypto(ssllib); |
|---|
| | 895 | version(darwin){ |
|---|
| | 896 | char[][] loadPathCrypto = [ "/usr/lib/libcrypto.dylib", "libcrypto.dylib" ]; |
|---|
| | 897 | cryptolib = loadLib(loadPathCrypto); |
|---|
| | 898 | if (cryptolib !is null) bindCrypto(cryptolib); |
|---|
| | 899 | } else { |
|---|
| | 900 | bindCrypto(ssllib); |
|---|
| | 901 | } |
|---|
| 884 | 902 | } |
|---|
| 885 | 903 | |
|---|
| … | … | |
| 906 | 924 | if (ssllib) |
|---|
| 907 | 925 | ssllib.unload(); |
|---|
| | 926 | version(darwin){ |
|---|
| | 927 | if (cryptolib) |
|---|
| | 928 | cryptolib.unload(); |
|---|
| | 929 | } |
|---|
| 908 | 930 | version(Win32) |
|---|
| 909 | 931 | { |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2012 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic