]> granicus.if.org Git - transmission/commit
#4400, #5462: Move SHA1 helpers to crypto-utils
authorMike Gelfand <mikedld@mikedld.com>
Thu, 4 Dec 2014 12:13:59 +0000 (12:13 +0000)
committerMike Gelfand <mikedld@mikedld.com>
Thu, 4 Dec 2014 12:13:59 +0000 (12:13 +0000)
commit4cfe7e7ddbc7a9d03d7e160c62f46f926e2699e8
tree1faa6d13a5ed3b2ea4d3e514db16cf77607bb174
parentf6f7bf8227b3e70522fccb81159f70b84af98684
#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.
14 files changed:
libtransmission/CMakeLists.txt
libtransmission/crypto-test.c
libtransmission/crypto-utils-openssl.c
libtransmission/crypto-utils.c
libtransmission/crypto-utils.h
libtransmission/crypto.c
libtransmission/crypto.h
libtransmission/inout.c
libtransmission/makemeta.c
libtransmission/metainfo.c
libtransmission/torrent-magnet.c
libtransmission/torrent.c
libtransmission/tr-dht.c
libtransmission/verify.c