summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2022-06-16 10:07:11 +0300
committerPanu Matilainen <pmatilai@redhat.com>2022-06-16 10:07:11 +0300
commit9f62aba3bd26eea51d411f0d17ee4dadbf2fd873 (patch)
tree7682d8ff7d4acd70c06747661e14322f5a8dbcfd
parentb7e71ffa4714a26618492b8200ab34b35a167b47 (diff)
downloadrpm-9f62aba3bd26eea51d411f0d17ee4dadbf2fd873.tar.gz
Drop support for openssl < 1.1
openssl 1.1 was released in 2016, this is old enough plenty. We should rather be worrying about openssl >= 3.0 at this point.
-rw-r--r--configure.ac54
-rw-r--r--rpmio/digest_openssl.c112
2 files changed, 2 insertions, 164 deletions
diff --git a/configure.ac b/configure.ac
index 70b6ef8f1..6cbdabca9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -281,63 +281,13 @@ else
WITH_OPENSSL_LIB=-lcrypto
fi
-AC_CHECK_HEADERS([openssl/evp.h], [], [
+AC_CHECK_HEADERS([openssl/evp.h openssl/rsa.h openssl/dsa.h], [], [
AC_MSG_ERROR([missing required OpenSSL header])
])
-AC_CHECK_HEADERS([openssl/rsa.h], [], [
- AC_MSG_ERROR([missing required OpenSSL header])
-])
-AC_CHECK_HEADERS([openssl/dsa.h], [], [
- AC_MSG_ERROR([missing required OpenSSL header])
-])
-
-AC_CHECK_LIB(crypto, EVP_DigestInit_ex, [], [
- AC_MSG_ERROR([required OpenSSL library 'libcrypto' missing or too old])
-])
-
-AC_CHECK_LIB(crypto, EVP_MD_CTX_new, [
- AC_DEFINE(HAVE_EVP_MD_CTX_NEW, 1, [Define to 1 if OpenSSL has EVP_MD_CTX_new])
- AC_SUBST(HAVE_EVP_MD_CTX_NEW, [1])
- ], [
- AC_CHECK_LIB(crypto, EVP_MD_CTX_create, [], [
- AC_MSG_ERROR([required OpenSSL library 'libcrypto' missing or too old])
- ])
-])
-AC_CHECK_LIB(crypto, EVP_PKEY_CTX_new, [], [
+AC_CHECK_LIB(crypto, EVP_MD_CTX_new, [], [
AC_MSG_ERROR([required OpenSSL library 'libcrypto' missing or too old])
])
-
-AC_CHECK_LIB(crypto, DSA_set0_key, [
- AC_DEFINE(HAVE_DSA_SET0_KEY, 1, [Define to 1 if OpenSSL has DSA_set0_key])
- AC_SUBST(HAVE_DSA_SET0_KEY, [1])
- ], []
-)
-
-AC_CHECK_LIB(crypto, DSA_set0_pqg, [
- AC_DEFINE(HAVE_DSA_SET0_PQG, 1, [Define to 1 if OpenSSL has DSA_set0_pqg])
- AC_SUBST(HAVE_DSA_SET0_PQG, [1])
- ], []
-)
-
-AC_CHECK_LIB(crypto, DSA_SIG_set0, [
- AC_DEFINE(HAVE_DSA_SIG_SET0, 1, [Define to 1 if OpenSSL has DSA_SIG_set0])
- AC_SUBST(HAVE_DSA_SIG_SET0, [1])
- ], []
-)
-
-AC_CHECK_LIB(crypto, RSA_set0_key, [
- AC_DEFINE(HAVE_RSA_SET0_KEY, 1, [Define to 1 if OpenSSL has RSA_set0_key])
- AC_SUBST(HAVE_RSA_SET0_KEY, [1])
- ], []
-)
-
-AC_CHECK_LIB(crypto, BN_bn2binpad, [
- AC_DEFINE(HAVE_BN2BINPAD, 1, [Define to 1 if OpenSSL has BN_bn2binpad])
- AC_SUBST(HAVE_BN2BINPAD, [1])
- ], []
-)
-
fi
AM_CONDITIONAL([WITH_OPENSSL],[test "$with_crypto" = openssl])
diff --git a/rpmio/digest_openssl.c b/rpmio/digest_openssl.c
index ec924f1ce..7cf363747 100644
--- a/rpmio/digest_openssl.c
+++ b/rpmio/digest_openssl.c
@@ -7,118 +7,6 @@
#include "rpmio/rpmpgp_internal.h"
-
-/* Compatibility functions for OpenSSL 1.0.2 */
-
-#ifndef HAVE_EVP_MD_CTX_NEW
-# define EVP_MD_CTX_new EVP_MD_CTX_create
-# define EVP_MD_CTX_free EVP_MD_CTX_destroy
-#endif
-
-#ifndef HAVE_RSA_SET0_KEY
-int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
-int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d)
-{
- if (!r) return 0;
-
- if (n) {
- r->n = n;
- }
-
- if (e) {
- r->e = e;
- }
-
- if (d) {
- r->d = d;
- }
-
- return 1;
-}
-#endif /* HAVE_RSA_SET0_KEY */
-
-#ifndef HAVE_DSA_SET0_KEY
-int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);
-
-int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key)
-{
- if (!d) return 0;
-
- if (pub_key) {
- d->pub_key = pub_key;
- }
-
- if (priv_key) {
- d->priv_key = priv_key;
- }
-
- return 1;
-}
-#endif /* HAVE_DSA_SET0_KEY */
-
-#ifndef HAVE_DSA_SET0_PQG
-int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g);
-
-int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g)
-{
- if (!d) return 0;
-
- if (p) {
- d->p = p;
- }
-
- if (q) {
- d->q = q;
- }
-
- if (g) {
- d->g = g;
- }
-
- return 1;
-}
-#endif /* HAVE_DSA_SET0_PQG */
-
-#ifndef HAVE_DSA_SIG_SET0
-int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s);
-
-int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s)
-{
- if (!sig) return 0;
-
- if (r) {
- sig->r = r;
- }
-
- if (s) {
- sig->s = s;
- }
-
- return 1;
-}
-#endif /* HAVE_DSA_SIG_SET0 */
-
-#ifndef HAVE_BN2BINPAD
-static int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen)
-{
- int i;
-
- i = BN_num_bytes(a);
- if (tolen < i)
- return -1;
-
- /* Add leading zeroes if necessary */
- if (tolen > i) {
- memset(to, 0, tolen - i);
- to += tolen - i;
- }
-
- BN_bn2bin(a, to);
-
- return tolen;
-}
-#endif /* HAVE_BN2BINPAD */
-
struct DIGEST_CTX_s {
rpmDigestFlags flags; /*!< Bit(s) to control digest operation. */
int algo; /*!< Used hash algorithm */