Commit e122b12c authored by Diego Biurrun's avatar Diego Biurrun

build: Drop gcrypt support

GnuTLS in combination with gcrypt has been deprecated since 2010.
parent bf2f748f
......@@ -1700,7 +1700,6 @@ CONFIG_EXTRA="
flacdsp
fmtconvert
g722dsp
gcrypt
gmp
golomb
gplv3
......@@ -2387,7 +2386,7 @@ xcbgrab_indev_deps="libxcb"
# protocols
ffrtmpcrypt_protocol_deps="!librtmp_protocol"
ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl"
ffrtmpcrypt_protocol_deps_any="gmp openssl"
ffrtmpcrypt_protocol_select="tcp_protocol"
ffrtmphttp_protocol_deps="!librtmp_protocol"
ffrtmphttp_protocol_select="http_protocol"
......@@ -4717,10 +4716,7 @@ enabled openssl && { { check_pkg_config openssl openssl/ssl.h OPENSSL_
check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
die "ERROR: openssl not found"; }
if enabled gnutls; then
{ check_lib gmp.h mpz_export -lgmp && enable gmp; } ||
{ check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; }
fi
enabled gnutls && check_lib gmp.h mpz_export -lgmp && enable gmp
# libdc1394 check
if enabled libdc1394; then
......
......@@ -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);
......
......@@ -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)
......
......@@ -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>
......
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment