From 8f9d8372d8ea9e85afdae870a497d00b2fab91c0 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 12 Apr 2019 20:30:03 -0700 Subject: [PATCH] Public Key was getting corrupted. --- interface/src/commerce/Wallet.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/interface/src/commerce/Wallet.cpp b/interface/src/commerce/Wallet.cpp index e6f8491053..2054206f87 100644 --- a/interface/src/commerce/Wallet.cpp +++ b/interface/src/commerce/Wallet.cpp @@ -302,8 +302,11 @@ QByteArray readPublicKey(QString filename) { qCDebug(commerce) << "parsed public key file successfully"; - retval.setRawData((char*)publicKeyDER, publicKeyLength); + QByteArray retval((char*)publicKeyDER, publicKeyLength); OPENSSL_free(publicKeyDER); + BIO_free(bufio); + file.close(); + return retval; } else { qCDebug(commerce) << "couldn't parse" << filename; } @@ -312,7 +315,7 @@ QByteArray readPublicKey(QString filename) { } else { qCDebug(commerce) << "couldn't open" << filename; } - return retval; + return QByteArray(); } // the private key should be read/copied into heap memory. For now, we need the EC_KEY struct @@ -387,7 +390,7 @@ Wallet::Wallet() { } else { status = (uint) WalletStatus::WALLET_STATUS_READY; } - + qCDebug(commerce) << "WALLET STATUS:" + keyStatus + " " + status; walletScriptingInterface->setWalletStatus(status); });