From f8a9d8bfa5e3bd008b62e7111a3dd5e741eb87f5 Mon Sep 17 00:00:00 2001 From: Dmitry Petukhov Date: Mon, 31 Dec 2018 22:30:36 +0500 Subject: [PATCH] Fix UnblindConfidentialPair: use IsFullyValid() for ephemeral_key if nNonce.vchCommitment contains invalid key of correct length, IsValid() check will pass, but then assertion will be hit when secp256k1_ec_pubkey_parse() is called on it inside CKey::ECDH(). Therefore, the check should be done with IsFullyValid() --- src/blind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blind.cpp b/src/blind.cpp index ac4e5ff886..2416d8403e 100644 --- a/src/blind.cpp +++ b/src/blind.cpp @@ -41,7 +41,7 @@ bool UnblindConfidentialPair(const CKey &key, const CConfidentialValue& confValu return false; } CPubKey ephemeral_key(nNonce.vchCommitment); - if (nNonce.vchCommitment.size() > 0 && !ephemeral_key.IsValid()) { + if (nNonce.vchCommitment.size() > 0 && !ephemeral_key.IsFullyValid()) { return false; }