aboutsummaryrefslogtreecommitdiff
path: root/src/tools/tor-checkkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/tor-checkkey.c')
-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);
}