summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorYawning Angel <yawning@schwanenlied.me>2016-06-14 06:14:28 +0000
committerNick Mathewson <nickm@torproject.org>2016-06-14 12:13:09 -0400
commitb563a3a09dd94892454210e82e46b62b947c5061 (patch)
tree320c2083a3ced93ba7a028e5aa77470ec42bea0a /src/tools
parent86f0b806812da8a53c25061acca500e0dcfb1103 (diff)
downloadtor-b563a3a09dd94892454210e82e46b62b947c5061.tar.gz
tor-b563a3a09dd94892454210e82e46b62b947c5061.zip
Bug 19406: OpenSSL made RSA and DH opaque in 1.1.0.
There's accessors to get at things, but it ends up being rather cumbersome. The only place where behavior should change is that the code will fail instead of attempting to generate a new DH key if our internal sanity check fails. Like the previous commit, this probably breaks snapshots prior to pre5.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/tor-checkkey.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/tools/tor-checkkey.c b/src/tools/tor-checkkey.c
index ed68bdf52c..8e957c2540 100644
--- a/src/tools/tor-checkkey.c
+++ b/src/tools/tor-checkkey.c
@@ -9,6 +9,7 @@
#include "torlog.h"
#include "util.h"
#include "compat.h"
+#include "compat_openssl.h"
#include <openssl/bn.h>
#include <openssl/rsa.h>
@@ -70,7 +71,15 @@ main(int c, char **v)
printf("%s\n",digest);
} else {
rsa = crypto_pk_get_rsa_(env);
- str = BN_bn2hex(rsa->n);
+
+ BIGNUM *rsa_n;
+#ifdef OPENSSL_1_1_API
+ BIGNUM *rsa_e, *rsa_d;
+ RSA_get0_key(rsa, &rsa_n, &rsa_e, &rsa_d);
+#else
+ rsa_n = rsa->n;
+#endif
+ str = BN_bn2hex(rsa_n);
printf("%s\n", str);
}