From 2c9ca0f89e2e18a211a91b155e2cf29564fe73bb Mon Sep 17 00:00:00 2001 From: Frank Scheiner Date: Thu, 14 Dec 2023 01:03:28 +0100 Subject: [PATCH] Allow GSI-OpenSSH w/HPN 9.3p1 to compile with OpenSSL versions < 1.1.x Patch courtesy of @msalle --- gsi_openssh/source/ssh-rsa.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gsi_openssh/source/ssh-rsa.c b/gsi_openssh/source/ssh-rsa.c index cbd04d379..6ad6cda73 100644 --- a/gsi_openssh/source/ssh-rsa.c +++ b/gsi_openssh/source/ssh-rsa.c @@ -296,6 +296,16 @@ ssh_rsa_deserialize_private(const char *ktype, struct sshbuf *b, return r; } +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) +static int RSA_bits(const RSA *r); + +static int +RSA_bits(const RSA *r) +{ + return BN_num_bits(r->n); +} +#endif + static const char * rsa_hash_alg_ident(int hash_alg) {