summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2016-11-23 16:42:00 +0100
committerDiego Biurrun <diego@biurrun.de>2016-11-25 18:46:53 +0100
commite122b12c88487ac8766ff4eb071856b0666f0134 (patch)
tree86b90ad795786a71da458d74c0a5c35dcb615c16 /libavformat
parentbf2f748fc74fff5272075e1fe1c07b4152421526 (diff)
build: Drop gcrypt support
GnuTLS in combination with gcrypt has been deprecated since 2010.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/hlsenc.c9
-rw-r--r--libavformat/rtmpdh.c18
-rw-r--r--libavformat/rtmpdh.h5
-rw-r--r--libavformat/tls_gnutls.c10
4 files changed, 2 insertions, 40 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 625531b881..05c9adb959 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -24,9 +24,7 @@
#include <config.h>
-#if CONFIG_GCRYPT
-#include <gcrypt.h>
-#elif CONFIG_OPENSSL
+#if CONFIG_OPENSSL
#include <openssl/rand.h>
#endif
@@ -86,10 +84,7 @@ typedef struct HLSContext {
static int randomize(uint8_t *buf, int len)
{
-#if CONFIG_GCRYPT
- gcry_randomize(buf, len, GCRY_VERY_STRONG_RANDOM);
- return 0;
-#elif CONFIG_OPENSSL
+#if CONFIG_OPENSSL
if (RAND_bytes(buf, len))
return 0;
return AVERROR(EIO);
diff --git a/libavformat/rtmpdh.c b/libavformat/rtmpdh.c
index 593b2b1edd..0593eac943 100644
--- a/libavformat/rtmpdh.c
+++ b/libavformat/rtmpdh.c
@@ -107,24 +107,6 @@ static int bn_modexp(FFBigNum bn, FFBigNum y, FFBigNum q, FFBigNum p)
mpz_powm(bn, y, q, p);
return 0;
}
-#elif CONFIG_GCRYPT
-#define bn_new(bn) bn = gcry_mpi_new(1)
-#define bn_free(bn) gcry_mpi_release(bn)
-#define bn_set_word(bn, w) gcry_mpi_set_ui(bn, w)
-#define bn_cmp(a, b) gcry_mpi_cmp(a, b)
-#define bn_copy(to, from) gcry_mpi_set(to, from)
-#define bn_sub_word(bn, w) gcry_mpi_sub_ui(bn, bn, w)
-#define bn_cmp_1(bn) gcry_mpi_cmp_ui(bn, 1)
-#define bn_num_bytes(bn) (gcry_mpi_get_nbits(bn) + 7) / 8
-#define bn_bn2bin(bn, buf, len) gcry_mpi_print(GCRYMPI_FMT_USG, buf, len, NULL, bn)
-#define bn_bin2bn(bn, buf, len) gcry_mpi_scan(&bn, GCRYMPI_FMT_USG, buf, len, NULL)
-#define bn_hex2bn(bn, buf, ret) ret = (gcry_mpi_scan(&bn, GCRYMPI_FMT_HEX, buf, 0, 0) == 0)
-#define bn_random(bn, num_bits) gcry_mpi_randomize(bn, num_bits, GCRY_WEAK_RANDOM)
-static int bn_modexp(FFBigNum bn, FFBigNum y, FFBigNum q, FFBigNum p)
-{
- gcry_mpi_powm(bn, y, q, p);
- return 0;
-}
#elif CONFIG_OPENSSL
#define bn_new(bn) bn = BN_new()
#define bn_free(bn) BN_free(bn)
diff --git a/libavformat/rtmpdh.h b/libavformat/rtmpdh.h
index 5233de0905..b4d6121d85 100644
--- a/libavformat/rtmpdh.h
+++ b/libavformat/rtmpdh.h
@@ -30,11 +30,6 @@
#include <gmp.h>
typedef mpz_ptr FFBigNum;
-#elif CONFIG_GCRYPT
-#include <gcrypt.h>
-
-typedef gcry_mpi_t FFBigNum;
-
#elif CONFIG_OPENSSL
#include <openssl/bn.h>
#include <openssl/dh.h>
diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c
index 3e29a45ce4..f8a612ad9b 100644
--- a/libavformat/tls_gnutls.c
+++ b/libavformat/tls_gnutls.c
@@ -35,12 +35,6 @@
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
-#if HAVE_THREADS && GNUTLS_VERSION_NUMBER <= 0x020b00
-#include <gcrypt.h>
-#include "libavutil/thread.h"
-GCRY_THREAD_OPTION_PTHREAD_IMPL;
-#endif
-
typedef struct TLSContext {
const AVClass *class;
TLSShared tls_shared;
@@ -52,10 +46,6 @@ typedef struct TLSContext {
void ff_gnutls_init(void)
{
avpriv_lock_avformat();
-#if HAVE_THREADS && GNUTLS_VERSION_NUMBER < 0x020b00
- if (gcry_control(GCRYCTL_ANY_INITIALIZATION_P) == 0)
- gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
-#endif
gnutls_global_init();
avpriv_unlock_avformat();
}