Commit Graph

128 Commits

Author SHA1 Message Date
Mike Gelfand 806f81c05c #5881: Explicitly state all possible crypto backend source files so that they are included into archive by `make dist` 2015-01-21 22:32:27 +00:00
Mike Gelfand 097b1dc50f #4400: Actually use CyaSSL (or some other) backend in libtransmission 2015-01-07 03:00:06 +00:00
Mike Gelfand c7d2a7f959 #4400: Add CyaSSL support 2015-01-07 02:04:08 +00:00
Mike Gelfand b928ae1ba8 Use libb64 instead of OpenSSL to encode/decode BASE64
Some crypto libraries (like CyaSSL, MatrixSSL and CommonCrypto) either
don't have or expose this functionality at all, expose only part of it,
or (like OpenSSL) have heavyweight API for it. Also, for the task as
easy as BASE64 encoding and decoding it's much better to use small and
simple specialized library.
2015-01-01 21:16:36 +00:00
Mike Gelfand 8b849a0910 #4400, #5462: Fix autotools configuration 2015-01-01 14:33:02 +00:00
Mike Gelfand 45f8bb8c40 #4400, #5462: Add possibility to test one crypto backend against another (reference) backend 2015-01-01 14:23:47 +00:00
Mike Gelfand a3fdd5f029 #5369: Improve file allocation error checking (initial patch by g.proskurin)
Additionally,
* always close file descriptor on error in cached_file_open (FD leak),
* only store file descriptor to tr_cached_file on success,
* call ftruncate after xfsctl-based preallocation so that correct size
  is reported by the system.
2014-12-10 18:23:11 +00:00
Mike Gelfand 117ab3e8d2 #4400, #5462: Move DH helpers to crypto-utils
On a way to factoring out OpenSSL support to a standalone file to ease
addition of other crypto libraries support in the future, move helpers
providing DH key exchange to crypto-utils.{c,h}. OpenSSL-related
functionality (DH context management) is moved to crypto-utils-openssl.c.
Since we know in advance that DH secret key management code will be the
same for most of backends, implement common functionality in separate
crypto-utils-fallback.c.

Add new tr_dh_ctx_t and tr_dh_secret_t types and functions to be
implemented by crypto backends:
* tr_dh_new - allocate DH context,
* tr_dh_free - free the context,
* tr_dh_make_key - generate private/public keypair,
* tr_dh_agree - perform DH key exchange and generate secret key,
* tr_dh_secret_derive - calculate secret key hash,
* tr_dh_secret_free - free the secret key,
* tr_dh_align_key - align some DH key in the buffer allocated for it.

Make DH secret key not accessible in plain form outside the crypto
backend. This allows for implementations where the key is managed by
the underlying library and is not even exposed to our backend.
2014-12-04 19:18:08 +00:00
Mike Gelfand f6f7bf8227 #4400, #5462: Move random helpers to crypto-utils
On a way to factoring out OpenSSL support to a standalone file to ease
addition of other crypto libraries support in the future, move helpers
providing random numbers/data generation to crypto-utils.{c,h}. OpenSSL-
related functionality (generation of cryptographically strong random
data) is moved to crypto-utils-openssl.c.

Rename functions to follow currently accepted style:
* tr_cryptoRandBuf -> tr_rand_buffer
* tr_cryptoRandInt -> tr_rand_int
* tr_cryptoWeakRandInt -> tr_rand_int_weak

Fix rare case of invalid value being returned from tr_rand_int. Return
value for abs(INT_MIN) may be undefined and thus negative, and so
tr_rand_int will return negative value which is incorrect (out of
requested and expected range).
2014-12-04 11:27:38 +00:00
Jordan Lee 90bbbaefc3 (trunk, libT) #4160: apply mike.dld's patch: 4160-05a-file-fmt.patch 2014-09-21 17:57:45 +00:00
Jordan Lee b325bc0a16 (trunk) #5759 compilation error, undefined reference to sqrt 2014-08-20 17:14:17 +00:00
Jordan Lee ab24ef9fcb use pkg-config to get the zlib cflags/libs; remove obsolete zlib.m4 macro 2014-07-13 21:54:56 +00:00
Jordan Lee 60a5c793d9 (trunk, libT) mike.dld's 4160-02a-path.patch: portability wrapper around file paths. 2014-07-03 21:58:39 +00:00
Jordan Lee 92daae473e mike.dld's portability improvements to libtransmission, pt 1 2014-06-23 02:38:53 +00:00
Jordan Lee db8a589ec4 add tr_makeMetaInfo() unit test for creating a single-file torrent 2014-06-08 20:01:10 +00:00
Jordan Lee 2ec84b2e32 (trunk, libT) #5573 'crypto unit test' -- written by mike.dld 2014-01-19 04:41:20 +00:00
Jordan Lee 36cc115c7b have the peer-id test follow the other unit test files' naming conventions 2013-09-08 19:30:16 +00:00
Jordan Lee 74d0f305a6 move platform.c's quota code into its own file. Fixes FTBFS reported in bug #5389 and is also a nice piece of encapsulation. Patch by rb07 2013-07-08 17:07:31 +00:00
Jordan Lee 908af43d99 add unit tests for tr-getopt 2013-04-13 18:27:36 +00:00
Jordan Lee 388da24dd0 (libT) add package-visible API hook for when a block is downloaded. Add unit test to confirm that when the last file finishes downloading, its .part suffix is removed and it's moved from the incomplete to complete dir 2013-01-26 23:08:51 +00:00
Jordan Lee f75027d5e9 make all the log functions/structs/enums use a single 'tr_log' namespace, such as tr_logGetQueue, tr_logAddInfo, tr_logIsLevelActive 2013-01-25 23:34:20 +00:00
Jordan Lee 016f38f066 (trunk) #1220 'change top folder names' -- added support for this in libtransmission's C and RPC APIs. 2013-01-19 08:43:26 +00:00
Jordan Lee c1559f3cc4 (trunk, libT) first drop of the tr_quark patch. 2012-12-22 20:35:19 +00:00
Jordan Lee e96ed247fe refactor libtransmission's tr_benc class as tr_variant. 2012-12-14 04:34:42 +00:00
Jordan Lee 8a2061f2cf move bitfield tests to their own file 2012-12-09 05:32:52 +00:00
Jordan Lee 9effd65f3e (trunk libT) #5131: replace JSON_parser with jsonsl to resolve licensing issue. 2012-11-11 04:26:56 +00:00
Jordan Lee 0630583637 (trunk, libT) #5081 'Transmission discards webseed URLs that have trailing whitespace' -- add unit test (currently failing) for this bug. 2012-10-14 18:02:47 +00:00
Jordan Lee 74c56f27b0 (trunk, libtransmission) #4934 "Create a test harness and use it for current tests" -- patch by gvdl 2012-08-18 16:07:05 +00:00
Jordan Lee 6d4858d8dd (trunk) #4732 "allow switching between internal and system libnatpmp" -- fixed with patch scarabeus and applied by me, so any patch breakage is probably mine... ;) 2012-02-04 01:28:15 +00:00
Jordan Lee 01f68ca846 (trunk libT) #4323 "Allow usage of system miniupnpc" -- fixed. 2011-10-09 02:05:52 +00:00
Jordan Lee 83c0e4f011 (trunk libT) break the mac build and introduce new crashes.
This is partially to address #4145 "Downloads stuck at 100%" by refactoring the bitset, bitfield, and tr_completion; however, the ripple effect is larger than usual so things may get worse in the short term before getting better.

livings124: to fix the mac build, remove bitset.[ch] from xcode
2011-03-28 16:31:05 +00:00
Jordan Lee 3cfef5eded (trunk libT) #117 "UDP tracker protocol support" -- working implementation; needs testing and valgrinding and review. 2011-03-13 00:18:11 +00:00
Jordan Lee b46d3a2713 (trunk libT) #117 "UDP tracker protocol support (BEP #15)" -- refactor announcer.c so that alternate tracker protocols can be supported.
This commit adds a set of package-visible structs and functions to allow delegating announces and scrapes to different protocol handlers. (Examples: struct tr_announce_request, struct tr_announce_response, struct tr_scrape_request, struct tr_scrape_response.) HTTP is the only protocol handler currently implemented; however, this provides a clean API for other protocol handlers, and having this in trunk will help shake out any bugs in this refactoring.

In addition, logging via the TR_DEBUG_FD environment variable is vastly improved in the announcer module now.
2011-03-11 04:19:01 +00:00
Jordan Lee 0c36e0c9de (trunk libT) remove the unused tr_ratecontrol code. switch webseed over to using tr_bandwidth. 2011-03-03 18:33:24 +00:00
Jordan Lee 6ab918a202 (trunk libT) code cleanup: moving bitset functions to their own .c file. 2011-02-21 01:40:19 +00:00
Jordan Lee 7df7d34f6d automake/autoconf; #includes in libtransmission 2011-02-18 00:32:19 +00:00
Juliusz Chroboczek c5e3cfecb9 Participate in UTP.
This adds code to participate in the UTP protocol, but without doing anything
useful yet -- we just shut down immediately any incoming connexion request.
2011-02-18 00:23:47 +00:00
Juliusz Chroboczek 8c02d6ce1f Add files tr-udp.[ch] to the build. 2011-01-09 21:48:06 +00:00
Charles Kerr db44d81b24 (trunk) #3256 "libtransmission/publish.[ch] should be replaced" -- apply publish.diff for 2.10 2010-06-19 14:33:10 +00:00
Charles Kerr e70bebf930 (trunk) #1521 "memory cache to reduce disk IO" -- commit block-cache-rc1.diff to trunk for the nightlies. 2010-06-19 14:25:11 +00:00
Charles Kerr 3ae99f79ec (trunk libT) #3293 "fggets() is overkill for parsing the blocklist" -- fixed in trunk for 2.00 2010-06-15 00:38:10 +00:00
Charles Kerr 2b9ab542cb (trunk) #3060 "Local Peer Discovery" -- in the code, rename LDS as LPD for Local Peer Discovery 2010-05-08 08:42:45 +00:00
Charles Kerr 5a34347f4f (trunk) #3060 -- Local Peer Discovery patch from Eszet 2010-05-01 16:04:00 +00:00
Charles Kerr b850349479 (trunk) #2993 "'Downloaded' much greater than 'Have' or 'verified'" -- add new congestion-based throttle for 2.0 2010-03-08 04:29:58 +00:00
Charles Kerr 2ff810d18f (trunk) use AC_ARG_VAR for some autoconf variables s.t. their values will persist between reconfs 2009-12-18 05:02:48 +00:00
Charles Kerr c0fa9c5e9d (trunk libT) fix bitset crash. add bitset.h to the automake file. 2009-11-24 18:22:57 +00:00
Charles Kerr f69e335291 (trunk) #2096: Magnet, BEP #9 support 2009-11-24 02:16:31 +00:00
Charles Kerr 9383a6abfd (trunk libT) #2096: add code magnet URL parser and unit tests 2009-11-20 04:38:19 +00:00
Charles Kerr b906c125ac (trunk libT) #2548: T's request queue can send out too many duplicate requests 2009-11-08 23:20:00 +00:00
Charles Kerr 05c77cc975 (trunk) #1483: move completed torrents to a user-specified directory + #629: different file extension for incomplete files 2009-10-19 05:05:00 +00:00