]> granicus.if.org Git - transmission/log
transmission
9 years agoFallback to message box warning icon if emblem-important is not provided by the icon...
Mike Gelfand [Sat, 17 Jan 2015 13:49:02 +0000 (13:49 +0000)]
Fallback to message box warning icon if emblem-important is not provided by the icon theme

9 years agoImprove the look of torrents with errors a bit (Qt client)
Mike Gelfand [Sat, 17 Jan 2015 01:23:51 +0000 (01:23 +0000)]
Improve the look of torrents with errors a bit (Qt client)

Display emblem over mime icon if torrent has error(s) to indicate the
issue.
Use normal text color instead of red when drawing selected item: there
is no easy way to be sure that red color looks nice on selection
background, and most of the time it doesn't. Using red color for non-
selected items is questionable too, but let's leave it at that for now.

9 years agoBump libevent version used by CMake to 2.0.22-stable
Mike Gelfand [Tue, 13 Jan 2015 21:27:31 +0000 (21:27 +0000)]
Bump libevent version used by CMake to 2.0.22-stable

9 years agoDo not write timezone to log, not a good idea after all (no standardized format)
Mike Gelfand [Tue, 13 Jan 2015 21:09:21 +0000 (21:09 +0000)]
Do not write timezone to log, not a good idea after all (no standardized format)

9 years agoAdd Transifex configuration file
Mike Gelfand [Mon, 12 Jan 2015 06:44:28 +0000 (06:44 +0000)]
Add Transifex configuration file

9 years agoAdd more information for translators (Qt client)
Mike Gelfand [Mon, 12 Jan 2015 06:18:52 +0000 (06:18 +0000)]
Add more information for translators (Qt client)

9 years agoInclude all CMake-related files into `make dist` output to facilitate testing
Mike Gelfand [Mon, 12 Jan 2015 00:54:40 +0000 (00:54 +0000)]
Include all CMake-related files into `make dist` output to facilitate testing

9 years agoMove numeric units to the right of values (per KDE HIG)
Mike Gelfand [Sun, 11 Jan 2015 21:10:46 +0000 (21:10 +0000)]
Move numeric units to the right of values (per KDE HIG)

Follow up commit to change the last phrase standing.

9 years agoImprove filter bar look (Qt client)
Mike Gelfand [Sun, 11 Jan 2015 15:01:13 +0000 (15:01 +0000)]
Improve filter bar look (Qt client)

Use normal but semi-transparent color instead of 'disabled' color for
counts drawing.
Do not leave empty space for icon when selected item doesn't have one.
Use null pixmaps/icons instead of non-null blank ones.
Implement our own sizeHint and minimumSizeHint to make sure both combos
have the same height.
Make activity combo width fixed, tracker combo width to fit its content
and line edit to occupy the rest.
Add 'Search...' placeholder to line edit.

9 years agoFurther adjustments to support PolarSSL 1.2
Mike Gelfand [Wed, 7 Jan 2015 14:05:58 +0000 (14:05 +0000)]
Further adjustments to support PolarSSL 1.2

9 years agoLower minimum PolarSSL version required down to 1.2
Mike Gelfand [Wed, 7 Jan 2015 13:41:22 +0000 (13:41 +0000)]
Lower minimum PolarSSL version required down to 1.2

9 years agoFix copyright years and SVN attributes on new files
Mike Gelfand [Wed, 7 Jan 2015 13:20:56 +0000 (13:20 +0000)]
Fix copyright years and SVN attributes on new files

9 years agoAdd PolarSSL support
Mike Gelfand [Wed, 7 Jan 2015 13:19:00 +0000 (13:19 +0000)]
Add PolarSSL support

9 years ago#4400: Access CyaSSL RNG in thread-safe manner
Mike Gelfand [Wed, 7 Jan 2015 13:13:19 +0000 (13:13 +0000)]
#4400: Access CyaSSL RNG in thread-safe manner

9 years ago#4400: Actually use CyaSSL (or some other) backend in libtransmission
Mike Gelfand [Wed, 7 Jan 2015 03:00:06 +0000 (03:00 +0000)]
#4400: Actually use CyaSSL (or some other) backend in libtransmission

9 years ago#4400: Fix CyaSSL version check (CMake)
Mike Gelfand [Wed, 7 Jan 2015 02:49:56 +0000 (02:49 +0000)]
#4400: Fix CyaSSL version check (CMake)

9 years ago#4400: Do not require OpenSSL anymore
Mike Gelfand [Wed, 7 Jan 2015 02:16:24 +0000 (02:16 +0000)]
#4400: Do not require OpenSSL anymore

9 years ago#4400: Add CyaSSL support
Mike Gelfand [Wed, 7 Jan 2015 02:04:08 +0000 (02:04 +0000)]
#4400: Add CyaSSL support

9 years agoDon't use ssize_t in bitfield.c (cleaner w/o it anyway)
Mike Gelfand [Sun, 4 Jan 2015 15:31:47 +0000 (15:31 +0000)]
Don't use ssize_t in bitfield.c (cleaner w/o it anyway)

9 years agoMake program name/version in about dialog larger again
Mike Gelfand [Sun, 4 Jan 2015 12:47:07 +0000 (12:47 +0000)]
Make program name/version in about dialog larger again

9 years agoChange sharing consent dialog into a QMessageBox
Mike Gelfand [Sun, 4 Jan 2015 12:29:10 +0000 (12:29 +0000)]
Change sharing consent dialog into a QMessageBox

9 years agoMark GTK and Qt clients as GUI programs on Windows (detach from console)
Mike Gelfand [Sun, 4 Jan 2015 10:57:09 +0000 (10:57 +0000)]
Mark GTK and Qt clients as GUI programs on Windows (detach from console)

9 years agoUse Faenza (1.3.1) as fallback on systems which do not support icon themes
Mike Gelfand [Sun, 4 Jan 2015 02:14:58 +0000 (02:14 +0000)]
Use Faenza (1.3.1) as fallback on systems which do not support icon themes

9 years agoUse (hopefully) better suited theme icons for some actions (Qt client)
Mike Gelfand [Sun, 4 Jan 2015 00:18:31 +0000 (00:18 +0000)]
Use (hopefully) better suited theme icons for some actions (Qt client)

9 years agoIncrease BASE64 encoding size when using system libb64
Mike Gelfand [Sat, 3 Jan 2015 21:35:20 +0000 (21:35 +0000)]
Increase BASE64 encoding size when using system libb64

Remove BASE64 reference testing as it's only libb64 now.
Improve the test to ignore \r and \n when comparing BASE-encoded
strings to not fail on system (unpatched) libb64.

9 years agoReplace tabs with spaces; remove trailing spaces
Mike Gelfand [Fri, 2 Jan 2015 11:15:31 +0000 (11:15 +0000)]
Replace tabs with spaces; remove trailing spaces

9 years agoKill some warnings when compiling on Windows
Mike Gelfand [Fri, 2 Jan 2015 04:02:13 +0000 (04:02 +0000)]
Kill some warnings when compiling on Windows

9 years ago#5700: Add -std=gnu++11 to QMAKE_CXXFLAGS for Qt 4 and g++/clang++
Mike Gelfand [Thu, 1 Jan 2015 23:54:35 +0000 (23:54 +0000)]
#5700: Add -std=gnu++11 to QMAKE_CXXFLAGS for Qt 4 and g++/clang++

9 years agoExternal CMake projects: supress developer warnings, allow skipping checksum checks...
Mike Gelfand [Thu, 1 Jan 2015 22:20:57 +0000 (22:20 +0000)]
External CMake projects: supress developer warnings, allow skipping checksum checks with SKIP_UPSTREAM_CHECKSUM

9 years agoFix Mac build (make libtransmission depend on libb64)
Mike Gelfand [Thu, 1 Jan 2015 22:00:02 +0000 (22:00 +0000)]
Fix Mac build (make libtransmission depend on libb64)

9 years agoFix Mac build (add libb64 to Xcode project)
Mike Gelfand [Thu, 1 Jan 2015 21:49:21 +0000 (21:49 +0000)]
Fix Mac build (add libb64 to Xcode project)

9 years agoUse libb64 instead of OpenSSL to encode/decode BASE64
Mike Gelfand [Thu, 1 Jan 2015 21:16:36 +0000 (21:16 +0000)]
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.

9 years ago#4400, #5462: Fix "make check" for po files
Mike Gelfand [Thu, 1 Jan 2015 14:48:10 +0000 (14:48 +0000)]
#4400, #5462: Fix "make check" for po files

9 years ago#4400, #5462: Fix autotools configuration
Mike Gelfand [Thu, 1 Jan 2015 14:33:02 +0000 (14:33 +0000)]
#4400, #5462: Fix autotools configuration

9 years ago#4400, #5462: Add possibility to test one crypto backend against another (reference...
Mike Gelfand [Thu, 1 Jan 2015 14:23:47 +0000 (14:23 +0000)]
#4400, #5462: Add possibility to test one crypto backend against another (reference) backend

9 years agoMake use of path button in relocate dialog (Qt client)
Mike Gelfand [Thu, 1 Jan 2015 05:02:13 +0000 (05:02 +0000)]
Make use of path button in relocate dialog (Qt client)

9 years agoUse QMimeDatabase to get icon names when compiling against Qt 5+
Mike Gelfand [Thu, 1 Jan 2015 02:28:18 +0000 (02:28 +0000)]
Use QMimeDatabase to get icon names when compiling against Qt 5+

9 years agoReduce initial torrent creation dialog size to minimum
Mike Gelfand [Wed, 31 Dec 2014 23:54:52 +0000 (23:54 +0000)]
Reduce initial torrent creation dialog size to minimum

Truncate text in path button to prevent width increase for long paths.

9 years agoRework torrent creation dialog in Qt client to load from .ui
Mike Gelfand [Wed, 31 Dec 2014 22:27:46 +0000 (22:27 +0000)]
Rework torrent creation dialog in Qt client to load from .ui

9 years agoAdd new TrPathButton class (Qt client)
Mike Gelfand [Wed, 31 Dec 2014 21:00:34 +0000 (21:00 +0000)]
Add new TrPathButton class (Qt client)

Make use of new button class in torrent options dialog.
Rework Utils::removeTrailingDirSeparator to return correct value for "/".

10 years agoRework torrent options dialog in Qt client to load from .ui
Mike Gelfand [Mon, 29 Dec 2014 04:03:56 +0000 (04:03 +0000)]
Rework torrent options dialog in Qt client to load from .ui

10 years agoUse QToolButton instead of QPushButton for path button, specify button icon size...
Mike Gelfand [Sun, 28 Dec 2014 04:04:58 +0000 (04:04 +0000)]
Use QToolButton instead of QPushButton for path button, specify button icon size explicitly

10 years agoAdd missing QToolButton forward declaration (Qt client)
Mike Gelfand [Sun, 28 Dec 2014 00:20:43 +0000 (00:20 +0000)]
Add missing QToolButton forward declaration (Qt client)

10 years ago#5809: Allow building against system dht library (patch by jbeich)
Mike Gelfand [Sun, 28 Dec 2014 00:14:46 +0000 (00:14 +0000)]
#5809: Allow building against system dht library (patch by jbeich)

10 years ago#5808: Don't embed path to DHT_LIBS in qtr.pro (patch by jbeich)
Mike Gelfand [Sun, 28 Dec 2014 00:02:50 +0000 (00:02 +0000)]
#5808: Don't embed path to DHT_LIBS in qtr.pro (patch by jbeich)

10 years ago#5805: Use bundled libutp by default if no system libutp found
Mike Gelfand [Sat, 27 Dec 2014 23:33:51 +0000 (23:33 +0000)]
#5805: Use bundled libutp by default if no system libutp found

10 years ago#5805: Allow building against system libutp (patch by jbeich)
Mike Gelfand [Sat, 27 Dec 2014 23:21:01 +0000 (23:21 +0000)]
#5805: Allow building against system libutp (patch by jbeich)

10 years agoAdd missing <QDebug> include (Qt 4 build break)
Mike Gelfand [Sat, 27 Dec 2014 20:08:10 +0000 (20:08 +0000)]
Add missing <QDebug> include (Qt 4 build break)

10 years agoFactor RPC logic out from session (Qt client)
Mike Gelfand [Sat, 27 Dec 2014 20:03:10 +0000 (20:03 +0000)]
Factor RPC logic out from session (Qt client)

10 years agoA bit of harmless refactoring
Mike Gelfand [Sat, 27 Dec 2014 14:07:14 +0000 (14:07 +0000)]
A bit of harmless refactoring

Prefer C++-style over C-style type casting.
Use qApp instead of QApplication/QCoreApplication::instance().
Use explicit QString::fromLatin1()/fromUtf8() where applicable.

10 years agoRefactor FreespaceLabel to make it possible for it to be created in Qt Designer
Mike Gelfand [Fri, 26 Dec 2014 18:41:47 +0000 (18:41 +0000)]
Refactor FreespaceLabel to make it possible for it to be created in Qt Designer

10 years agoFix the rest of :: formatting in C++ code
Mike Gelfand [Fri, 26 Dec 2014 14:22:35 +0000 (14:22 +0000)]
Fix the rest of :: formatting in C++ code

10 years agoFix directory name display in relocate dialog
Mike Gelfand [Fri, 26 Dec 2014 14:21:47 +0000 (14:21 +0000)]
Fix directory name display in relocate dialog

10 years agoRework relocate dialog in Qt client to load from .ui
Mike Gelfand [Fri, 26 Dec 2014 10:35:00 +0000 (10:35 +0000)]
Rework relocate dialog in Qt client to load from .ui

10 years agoFix up some about dialog leftovers, sync Qt client translations
Mike Gelfand [Thu, 25 Dec 2014 21:51:59 +0000 (21:51 +0000)]
Fix up some about dialog leftovers, sync Qt client translations

10 years agoRework about dialog in Qt client to load from .ui
Mike Gelfand [Thu, 25 Dec 2014 19:39:45 +0000 (19:39 +0000)]
Rework about dialog in Qt client to load from .ui

10 years agoMove numeric units to the right of values (per KDE HIG)
Mike Gelfand [Mon, 22 Dec 2014 03:06:09 +0000 (03:06 +0000)]
Move numeric units to the right of values (per KDE HIG)

Sync translations with the code. Adjust translations for changed phrases
(hopefully correct for the most of them).

One phrase still left untouched (Preferences -> Downloading), need to
think on better wording.

10 years ago#4050: Use TRANSLATIONS_DIR macro as a hint for Qt client translation files location
Mike Gelfand [Mon, 22 Dec 2014 01:08:19 +0000 (01:08 +0000)]
#4050: Use TRANSLATIONS_DIR macro as a hint for Qt client translation files location

10 years ago#5543: Add a warning panel with id of duplicate torrent (patch by rb07 + personal...
Mike Gelfand [Mon, 22 Dec 2014 00:02:27 +0000 (00:02 +0000)]
#5543: Add a warning panel with id of duplicate torrent (patch by rb07 + personal touch)

10 years agoFix license wording in Qt client .cc files to match the rest of the code.
Mike Gelfand [Sun, 21 Dec 2014 23:49:39 +0000 (23:49 +0000)]
Fix license wording in Qt client .cc files to match the rest of the code.

10 years agoRework session dialog in Qt client to load from .ui
Mike Gelfand [Sun, 21 Dec 2014 23:46:31 +0000 (23:46 +0000)]
Rework session dialog in Qt client to load from .ui

10 years agoMove filter text clearing button into line edit. Use Qt-provided button on Qt 5.2+.
Mike Gelfand [Sun, 21 Dec 2014 15:34:52 +0000 (15:34 +0000)]
Move filter text clearing button into line edit. Use Qt-provided button on Qt 5.2+.

10 years agoRework statistics dialog in Qt client to load from .ui
Mike Gelfand [Sun, 21 Dec 2014 13:57:15 +0000 (13:57 +0000)]
Rework statistics dialog in Qt client to load from .ui

Fix "Started %n time(s)" phrase (remove space in "time (s)", add proper
English translation for numeric forms).

10 years agoImprove cross-compilation support when using CMake
Mike Gelfand [Sat, 20 Dec 2014 22:28:43 +0000 (22:28 +0000)]
Improve cross-compilation support when using CMake

10 years agoMove status bar creation to mainwin.ui
Mike Gelfand [Thu, 18 Dec 2014 01:30:50 +0000 (01:30 +0000)]
Move status bar creation to mainwin.ui

Among other things,
* fix turtle icons size (20x14 -> 16x16)
* use QIcon states instead of changing the turtle icon ourselves each
  time (unchecked - off, checked - on)
* make speed limit action in tray menu checkable
* simplify status bar buttons drawing and use QToolButton instead of
  QPushButton

10 years agoSync Qt client translations with the code
Mike Gelfand [Sun, 14 Dec 2014 18:33:28 +0000 (18:33 +0000)]
Sync Qt client translations with the code

10 years agoRework torrent details dialog in Qt client to load from .ui
Mike Gelfand [Sun, 14 Dec 2014 18:12:21 +0000 (18:12 +0000)]
Rework torrent details dialog in Qt client to load from .ui

Make squeeze labels (used for values on Information tab) display tooltip
on hover if their text doesn't fit. Make selective labels (same as in
GTK+ client) text selectable with keyboard in addition to mouse.
Prevent dialog width growth occured before to fit long error texts.

10 years agoDo not use printf-style formatting in C++ code
Mike Gelfand [Sun, 14 Dec 2014 15:34:31 +0000 (15:34 +0000)]
Do not use printf-style formatting in C++ code

10 years agoDo not use void to denote argumentless functions in C++ code
Mike Gelfand [Sun, 14 Dec 2014 11:57:23 +0000 (11:57 +0000)]
Do not use void to denote argumentless functions in C++ code

10 years agoFix format specifier warning introduced couple commits earlier
Mike Gelfand [Sat, 13 Dec 2014 17:04:14 +0000 (17:04 +0000)]
Fix format specifier warning introduced couple commits earlier

10 years agoDon't mess with MinGW printf support for now (tricky)
Mike Gelfand [Sat, 13 Dec 2014 16:00:14 +0000 (16:00 +0000)]
Don't mess with MinGW printf support for now (tricky)

10 years agoFix compilation on Windows
Mike Gelfand [Sat, 13 Dec 2014 15:22:39 +0000 (15:22 +0000)]
Fix compilation on Windows

This should not affect non-Win32 platforms in any way.
As for Win32 (both MinGW and MSVC), this should hopefully allow for
unpatched compilation. Correct functioning is not yet guaranteed though.

10 years agoMake utp_config.h usable with MSVC (#warning directive is not standard)
Mike Gelfand [Sat, 13 Dec 2014 10:03:44 +0000 (10:03 +0000)]
Make utp_config.h usable with MSVC (#warning directive is not standard)

10 years agoStrip needless const& specifiers on SIGNAL and SLOT arguments (Qt client)
Mike Gelfand [Sat, 13 Dec 2014 09:04:10 +0000 (09:04 +0000)]
Strip needless const& specifiers on SIGNAL and SLOT arguments (Qt client)

10 years agoFix various cppcheck comments for Qt client code
Mike Gelfand [Fri, 12 Dec 2014 23:52:17 +0000 (23:52 +0000)]
Fix various cppcheck comments for Qt client code

10 years agoRemove redundant "struct" keyword use in C++ code (Qt client)
Mike Gelfand [Fri, 12 Dec 2014 23:21:04 +0000 (23:21 +0000)]
Remove redundant "struct" keyword use in C++ code (Qt client)

10 years agoStrip spaces around :: in C++ code (Qt client)
Mike Gelfand [Fri, 12 Dec 2014 23:05:10 +0000 (23:05 +0000)]
Strip spaces around :: in C++ code (Qt client)

10 years ago#5848: Use theme-provided icons in Qt client (patch by equeim + small additions)
Mike Gelfand [Fri, 12 Dec 2014 21:47:22 +0000 (21:47 +0000)]
#5848: Use theme-provided icons in Qt client (patch by equeim + small additions)

10 years ago#5841: Fix initial watchdir scan in Qt client
Mike Gelfand [Thu, 11 Dec 2014 22:21:24 +0000 (22:21 +0000)]
#5841: Fix initial watchdir scan in Qt client

Run the initial scan after application has finished initializing and
session has been created. Otherwise, adding torrents is a no-op.

10 years ago#5685: Use proper icon in Qt client desktop file (reported by rahulsundaram)
Mike Gelfand [Thu, 11 Dec 2014 20:13:45 +0000 (20:13 +0000)]
#5685: Use proper icon in Qt client desktop file (reported by rahulsundaram)

10 years ago#5692: Fix build under Cygwin (patch by rb07)
Mike Gelfand [Thu, 11 Dec 2014 20:06:07 +0000 (20:06 +0000)]
#5692: Fix build under Cygwin (patch by rb07)

10 years ago#5407: Fix crash on Mac when pausing torrents (patch by x190)
Mike Gelfand [Thu, 11 Dec 2014 19:57:52 +0000 (19:57 +0000)]
#5407: Fix crash on Mac when pausing torrents (patch by x190)

10 years agoFix utils test; move -Winline to C-only flags (it only harms C++)
Mike Gelfand [Thu, 11 Dec 2014 05:25:26 +0000 (05:25 +0000)]
Fix utils test; move -Winline to C-only flags (it only harms C++)

10 years agoFix a couple of ordinary and pedantic warnings
Mike Gelfand [Thu, 11 Dec 2014 05:11:02 +0000 (05:11 +0000)]
Fix a couple of ordinary and pedantic warnings

Add previously missing -Wall to warning flags in CMake. Remove -Wformat
and -Wvariadic-macros (enabled by default; latter is not meaningful in
C99 mode we use), -Wdeclaration-after-statement (again, not needed as
we use C99). Move -Wmissing-declarations to C-only flags (GCC man says
so).

Add copyrights year to crypto-utils-fallback.c.

10 years agoAdd missing svn:keywords property to recently (and not so recently) added files
Mike Gelfand [Wed, 10 Dec 2014 18:58:12 +0000 (18:58 +0000)]
Add missing svn:keywords property to recently (and not so recently) added files

10 years agoFix tr_moveFile error reporting
Mike Gelfand [Wed, 10 Dec 2014 18:37:58 +0000 (18:37 +0000)]
Fix tr_moveFile error reporting

Remove unused `renamed` argument.
Use tr_error instead of errno to report errors to support Win32 file
wrappers which do not map Windows error codes to POSIX ones.
Return bool instead of int (0/-1).

Uncomment tr_error_prefix and tr_error_propagate_prefixed functions.

10 years ago#5369: Improve file allocation error checking (initial patch by g.proskurin)
Mike Gelfand [Wed, 10 Dec 2014 18:23:11 +0000 (18:23 +0000)]
#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.

10 years agoFix small memory leaks in crypto (base64) and rename (multi-file torrent) unit tests
Mike Gelfand [Sun, 7 Dec 2014 10:42:12 +0000 (10:42 +0000)]
Fix small memory leaks in crypto (base64) and rename (multi-file torrent) unit tests

10 years agoIncrease move test timeouts from 5 sec to 5 min
Mike Gelfand [Sun, 7 Dec 2014 10:10:16 +0000 (10:10 +0000)]
Increase move test timeouts from 5 sec to 5 min

10 years agoInclude CTest to enable memcheck
Mike Gelfand [Sun, 7 Dec 2014 10:00:34 +0000 (10:00 +0000)]
Include CTest to enable memcheck

10 years agoRemove duplicate -Wcast-align flag, add canonicalize_file_name function check
Mike Gelfand [Sat, 6 Dec 2014 16:28:53 +0000 (16:28 +0000)]
Remove duplicate -Wcast-align flag, add canonicalize_file_name function check

10 years ago#4400, #5462: Fix Mac build by adding new crypto-utils files to Xcode project.
Mike Gelfand [Fri, 5 Dec 2014 23:41:09 +0000 (23:41 +0000)]
#4400, #5462: Fix Mac build by adding new crypto-utils files to Xcode project.

10 years ago#4400, #5462: Move SHA1/HEX helpers to crypto-utils
Mike Gelfand [Thu, 4 Dec 2014 20:53:56 +0000 (20:53 +0000)]
#4400, #5462: Move SHA1/HEX 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 SHA1/HEX conversion to crypto-utils.{c,h}.

Rename functions:
* tr_sha1_to_hex -> tr_binary_to_hex (add length argument),
* tr_hex_to_sha1 -> tr_hex_to_binary (add length argument).

Make tr_sha1_to_hex and tr_hex_to_sha1 wrappers around above functions.

10 years ago#4400, #5462: Move SSHA1 helpers to crypto-utils
Mike Gelfand [Thu, 4 Dec 2014 20:45:18 +0000 (20:45 +0000)]
#4400, #5462: Move SSHA1 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 SSHA1 password generation and checking to crypto-utils.{c,h}.

10 years ago#4400, #5462: Move BASE64 helpers to crypto-utils
Mike Gelfand [Thu, 4 Dec 2014 19:58:34 +0000 (19:58 +0000)]
#4400, #5462: Move BASE64 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 BASE64 encoding and decoding to crypto-utils.{c,h}. OpenSSL-
related functionality is moved to crypto-utils-openssl.c.

Add new functions to be implemented by crypto backends:
* tr_base64_encode_impl - encode from binary to BASE64,
* tr_base64_decode_impl - decode from BASE64 to binary.

Change `tr_base64_encode` and `tr_base64_decode` functions to expect
non-negative input data length which is considered real and never adjusted.
To process null-terminated strings (which was achieved before by passing 0
or -1 as input data length), add new `tr_base64_encode_str` and
`tr_base64_decode_str` functions which do not accept input data length as
an argument but calculate it on their own.

10 years ago#4400, #5462: Move DH helpers to crypto-utils
Mike Gelfand [Thu, 4 Dec 2014 19:18:08 +0000 (19:18 +0000)]
#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.

10 years ago#4400, #5462: Do not assert on input to SHA1 or RC4 if input length is 0.
Mike Gelfand [Thu, 4 Dec 2014 18:20:46 +0000 (18:20 +0000)]
#4400, #5462: Do not assert on input to SHA1 or RC4 if input length is 0.

10 years ago#4400, #5462: Move RC4 helpers to crypto-utils
Mike Gelfand [Thu, 4 Dec 2014 12:37:08 +0000 (12:37 +0000)]
#4400, #5462: Move RC4 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 RC4 ciphering to crypto-utils.{c,h}. OpenSSL-related
functionality (RC4 context management) is moved to crypto-utils-openssl.c.

Add new tr_rc4_ctx_t type and functions to be implemented by crypto
backends:
* tr_rc4_new - allocate RC4 context,
* tr_rc4_free - free the context,
* tr_rc4_set_key - set cipher key,
* tr_rc4_process - cipher memory block.

10 years ago#4400, #5462: Move SHA1 helpers to crypto-utils
Mike Gelfand [Thu, 4 Dec 2014 12:13:59 +0000 (12:13 +0000)]
#4400, #5462: Move SHA1 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 SHA1 calculation to crypto-utils.{c,h}. OpenSSL-related
functionality (SHA1 context management) is moved to crypto-utils-openssl.c.

Add new tr_sha1_ctx_t type and functions to be implemented by crypto
backends:
* tr_sha1_init - allocate SHA1 context and and initialize it,
* tr_sha1_update - hash some [more] data,
* tr_sha1_final - finish hash calculation and free the context.

Add new files to CMakeLists.txt (leftover from previous commit) to fix
CMake-based configuration.

10 years ago#4400, #5462: Move random helpers to crypto-utils
Mike Gelfand [Thu, 4 Dec 2014 11:27:38 +0000 (11:27 +0000)]
#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).