Commit Diff
Diff:
e60b2fdd40400293b6df5ce7f2ee3ec526b136a6
b986c338665358f53c61b9118f7fa7fe6ead28b3
Commit:
b986c338665358f53c61b9118f7fa7fe6ead28b3
Tree:
aef4bc3e7251237fe7ad565203457c65eed22148
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Thu Sep 17 12:14:16 2020 UTC
Message:
remove compatibility code for OPENSSL_VERSION_NUMBER < 0x10100000L we rely on libressl on NetBSD and OpenBSD, and FreeBSD 11.4 and Linux Raspbian seem to work without this. Tested on FreeBSD and Raspbian Linux
blob - b0f91dbd4a9a9cd7c92a32ba31c460653ddfa98f
blob + a75a4c1285bc34defce11478a256f64f7c73cf16
--- sign.c
+++ sign.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: sign.c,v 1.14 2020/08/24 06:05:30 pjp Exp $
+ * $Id: sign.c,v 1.15 2020/09/17 12:14:16 pjp Exp $
*/
#include <sys/param.h> /* for MIN() */
@@ -187,20 +187,6 @@ int notglue(ddDB *, struct rbtree *, char *);
char * canonical_sort(char **, int, int *);
int cs_cmp(const void *, const void *);
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
-
-BN_GENCB * BN_GENCB_new(void);
-void BN_GENCB_free(BN_GENCB *);
-
-int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
-int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q);
-int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp);
-
-void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d);
-void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q);
-void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, const BIGNUM **iqmp);
-#endif
-
extern int debug;
extern int verbose;
extern int bytes_received;
@@ -7149,136 +7135,6 @@ debug_bindump(const char *key, int keylen)
return;
}
-
-/* carelessly copied from https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes */
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
-
-int
-RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d)
-{
- /* If the fields n and e in r are NULL, the corresponding input
- * parameters MUST be non-NULL for n and e. d may be
- * left NULL (in case only the public key is used).
- */
- if ((r->n == NULL && n == NULL)
- || (r->e == NULL && e == NULL))
- return 0;
-
- if (n != NULL) {
- BN_free(r->n);
- r->n = n;
- }
- if (e != NULL) {
- BN_free(r->e);
- r->e = e;
- }
- if (d != NULL) {
- BN_free(r->d);
- r->d = d;
- }
-
- return 1;
-}
-
-int
-RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q)
-{
- /* If the fields p and q in r are NULL, the corresponding input
- * parameters MUST be non-NULL.
- */
- if ((r->p == NULL && p == NULL)
- || (r->q == NULL && q == NULL))
- return 0;
-
- if (p != NULL) {
- BN_free(r->p);
- r->p = p;
- }
- if (q != NULL) {
- BN_free(r->q);
- r->q = q;
- }
-
- return 1;
-}
-
-int
-RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp)
-{
- /* If the fields dmp1, dmq1 and iqmp in r are NULL, the corresponding input
- * parameters MUST be non-NULL.
- */
- if ((r->dmp1 == NULL && dmp1 == NULL)
- || (r->dmq1 == NULL && dmq1 == NULL)
- || (r->iqmp == NULL && iqmp == NULL))
- return 0;
-
- if (dmp1 != NULL) {
- BN_free(r->dmp1);
- r->dmp1 = dmp1;
- }
- if (dmq1 != NULL) {
- BN_free(r->dmq1);
- r->dmq1 = dmq1;
- }
- if (iqmp != NULL) {
- BN_free(r->iqmp);
- r->iqmp = iqmp;
- }
-
- return 1;
-}
-
-void
-RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
-{
- if (n != NULL)
- *n = r->n;
- if (e != NULL)
- *e = r->e;
- if (d != NULL)
- *d = r->d;
-}
-
-void
-RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q)
-{
- if (p != NULL)
- *p = r->p;
- if (q != NULL)
- *q = r->q;
-}
-
-void
-RSA_get0_crt_params(const RSA *r,
- const BIGNUM **dmp1, const BIGNUM **dmq1,
- const BIGNUM **iqmp)
-{
- if (dmp1 != NULL)
- *dmp1 = r->dmp1;
- if (dmq1 != NULL)
- *dmq1 = r->dmq1;
- if (iqmp != NULL)
- *iqmp = r->iqmp;
-}
-
-BN_GENCB *
-BN_GENCB_new(void)
-{
- static BN_GENCB cb;
-
- return (&cb);
-}
-
-void
-BN_GENCB_free(BN_GENCB *cb)
-{
- return;
-}
-
-
-#endif
-
/*
* sign() - sign an RR
repomaster@centroid.eu