From 6f2357c695bc90896c2bd86a2e02da6b0c6c6f5e Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 11 Nov 2016 12:44:44 -0500 Subject: [PATCH] fixed openssl 1.1 crash --- Identity.cpp | 2 +- Signature.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Identity.cpp b/Identity.cpp index 9e07382f..f39e9bd8 100644 --- a/Identity.cpp +++ b/Identity.cpp @@ -488,7 +488,7 @@ namespace data switch (m_Public->GetSigningKeyType ()) { case SIGNING_KEY_TYPE_DSA_SHA1: - m_Signer.reset (new i2p::crypto::DSASigner (m_SigningPrivateKey)); + m_Signer.reset (new i2p::crypto::DSASigner (m_SigningPrivateKey, m_Public->GetStandardIdentity ().signingKey)); break; case SIGNING_KEY_TYPE_ECDSA_SHA256_P256: m_Signer.reset (new i2p::crypto::ECDSAP256Signer (m_SigningPrivateKey)); diff --git a/Signature.h b/Signature.h index 7962bc2d..1d90d8a3 100644 --- a/Signature.h +++ b/Signature.h @@ -77,10 +77,11 @@ namespace crypto { public: - DSASigner (const uint8_t * signingPrivateKey) + DSASigner (const uint8_t * signingPrivateKey, const uint8_t * signingPublicKey) + // openssl 1.1 always requires DSA public key even for signing { m_PrivateKey = CreateDSA (); - DSA_set0_key (m_PrivateKey, NULL, BN_bin2bn (signingPrivateKey, DSA_PRIVATE_KEY_LENGTH, NULL)); + DSA_set0_key (m_PrivateKey, BN_bin2bn (signingPublicKey, DSA_PUBLIC_KEY_LENGTH, NULL), BN_bin2bn (signingPrivateKey, DSA_PRIVATE_KEY_LENGTH, NULL)); } ~DSASigner ()