From d29cacac856882b153fa206c49091188af5d95aa Mon Sep 17 00:00:00 2001 From: Cyp Date: Wed, 31 Aug 2016 17:44:45 +0200 Subject: [PATCH] Improve compilability with OpenSSL 1.1.0+. Fixes ticket:4493. --- lib/framework/crc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/framework/crc.cpp b/lib/framework/crc.cpp index c9b455953e4..cf23c6e6398 100644 --- a/lib/framework/crc.cpp +++ b/lib/framework/crc.cpp @@ -331,7 +331,7 @@ bool EcKey::verify(Sig const &sig, void const *data, size_t dataLen) const EcKey::Key EcKey::toBytes(Privacy privacy) const { - int (*toBytesFunc)(EC_KEY * key, unsigned char **out) = nullptr; + decltype(i2o_ECPublicKey) *toBytesFunc = nullptr; // int (EC_KEY const *key, unsigned char **out), "const" only in OpenSSL 1.1.0+ switch (privacy) { case Private: toBytesFunc = i2d_ECPrivateKey; break; // Note that the format for private keys is somewhat bloated, and even contains the public key which could be (efficiently) computed from the private key. @@ -358,7 +358,7 @@ EcKey::Key EcKey::toBytes(Privacy privacy) const void EcKey::fromBytes(EcKey::Key const &key, EcKey::Privacy privacy) { - EC_KEY *(*fromBytesFunc)(EC_KEY **key, unsigned char const **in, long len) = nullptr; + decltype(o2i_ECPublicKey) *fromBytesFunc = nullptr; // EC_KEY *(EC_KEY **key, unsigned char const **in, long len) switch (privacy) { case Private: fromBytesFunc = d2i_ECPrivateKey; break;