From bd49160c55412ffdadc4650a9e9b5913bfecfdf3 Mon Sep 17 00:00:00 2001 From: "yuseok.jeon" Date: Thu, 5 Jun 2014 10:15:38 +0900 Subject: [PATCH] Bug fix Change-Id: I1bb23b4d1cee0479926a0c521b59593fd43a5d3d Signed-off-by: yuseok.jeon --- src/manager/common/client-key-impl.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/manager/common/client-key-impl.cpp b/src/manager/common/client-key-impl.cpp index 684049a..9d960a5 100644 --- a/src/manager/common/client-key-impl.cpp +++ b/src/manager/common/client-key-impl.cpp @@ -60,7 +60,7 @@ KeyImpl& KeyImpl::operator=(KeyImpl &&second) { KeyImpl::KeyImpl(const RawBuffer &data, KeyType type, const std::string &password) : m_type(KeyType::KEY_NONE) { - int size = 0; + int ret = 0; RSA *rsa = NULL; char *pass = NULL; std::string passtmp(password); @@ -97,14 +97,14 @@ KeyImpl::KeyImpl(const RawBuffer &data, KeyType type, const std::string &passwor BIO *bio = BIO_new(BIO_s_mem()); if (type == KeyType::KEY_RSA_PUBLIC) { - size = i2d_RSAPublicKey_bio(bio, rsa); + ret = i2d_RSAPublicKey_bio(bio, rsa); } else { - size = i2d_RSAPrivateKey_bio(bio, rsa); + ret = i2d_RSAPrivateKey_bio(bio, rsa); } - if (size > 0) { - m_key.resize(size); - BIO_read(bio, m_key.data(), m_key.size()); + if (ret > 0) { + m_key.resize(data.size()); + BIO_read(bio, m_key.data(), data.size()); m_type = type; } BIO_free_all(bio); -- 2.7.4