Control: tags -1 + patch

The attached patch fixes the build of the current gvpe in unstable,
which is different to the version that the bug was originally reported
against; the compile errors are different, more like:

conf.C: In constructor 
‘configuration_parser::configuration_parser(configuration&, bool, int, char**)’:
conf.C:653:37: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
             if (BN_cmp (conf.rsa_key->n, conf.thisnode->rsa_key->n) != 0
                                     ^~

>From 57c6de81da714b76d3a8e3b0ffca1db026f961ab Mon Sep 17 00:00:00 2001
From: "Chris West (Faux)" <g...@goeswhere.com>
Date: Wed, 22 Nov 2017 12:12:37 +0000
Subject: [PATCH] use RSA getters for libssl 1.1 compat

---
 gvpe-3.0/debian/control |  2 +-
 gvpe-3.0/src/conf.C     | 16 ++++++++++------
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/gvpe-3.0/debian/control b/gvpe-3.0/debian/control
index a3f61df..4073fdf 100644
--- a/gvpe-3.0/debian/control
+++ b/gvpe-3.0/debian/control
@@ -3,7 +3,7 @@ Section: net
 Priority: extra
 Maintainer: TANIGUCHI Takaki <tak...@debian.org>
 Build-Depends: debhelper (>= 9), autotools-dev,
-	libssl1.0-dev | libssl-dev (<< 1.1.0~),
+	libssl-dev,
 	dh-autoreconf,
 	info, zlib1g-dev, texinfo
 Standards-Version: 3.9.8
diff --git a/gvpe-3.0/src/conf.C b/gvpe-3.0/src/conf.C
index 51eaab6..da06312 100644
--- a/gvpe-3.0/src/conf.C
+++ b/gvpe-3.0/src/conf.C
@@ -650,12 +650,16 @@ configuration_parser::configuration_parser (configuration &conf,
             }
 
           if (conf.rsa_key && conf.thisnode->rsa_key)
-            if (BN_cmp (conf.rsa_key->n, conf.thisnode->rsa_key->n) != 0
-                || BN_cmp (conf.rsa_key->e, conf.thisnode->rsa_key->e) != 0)
-              {
-                slog (L_NOTICE, _("private hostkey and public node key mismatch: is '%s' the correct node?"), ::thisnode);
-                exit (EXIT_FAILURE);
-              }
+            {
+              const BIGNUM *conf_n, *conf_e, *thisnode_n, *thisnode_e;
+              RSA_get0_key(conf.rsa_key, &conf_n, &conf_e, NULL);
+              RSA_get0_key(conf.thisnode->rsa_key, &thisnode_n, &thisnode_e, NULL);
+              if (BN_cmp (conf_n, thisnode_n) != 0 || BN_cmp (conf_e, thisnode_e) != 0)
+                {
+                  slog (L_NOTICE, _("private hostkey and public node key mismatch: is '%s' the correct node?"), ::thisnode);
+                  exit (EXIT_FAILURE);
+                }
+            }
         }
     }
 
-- 
2.15.0

Reply via email to