Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
•All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
keepass.cpp
Go to the documentation of this file.
123 void CKeePassIntegrator::CKeePassRequest::addStrParameter(const std::string& strName, const std::string& strValue)
128 void CKeePassIntegrator::CKeePassRequest::addStrParameter(const std::string& strName, const SecureString& sValue)
151 addStrParameter("Nonce", std::string(sNonceBase64Secure.data(), sNonceBase64Secure.size())); // Plain
194 SecureString CKeePassIntegrator::CKeePassResponse::decrypt(const std::string& strValueBase64Encrypted)
205 std::vector<CKeePassIntegrator::CKeePassEntry> CKeePassIntegrator::CKeePassResponse::getEntries()
237 std::string CKeePassIntegrator::constructHTTPPost(const std::string& strMsg, const std::map<std::string,std::string>& mapRequestHeaders)
287 void CKeePassIntegrator::doHTTPPost(const std::string& sRequest, int& nStatusRet, std::string& strResponseRet)
295 struct evhttp_connection *evcon = evhttp_connection_base_new(base, nullptr, KEEPASS_HTTP_HOST, DEFAULT_KEEPASS_HTTP_PORT); // TODO RAII
301 struct evhttp_request *req = evhttp_request_new(http_request_done, (void*)&response); // TODO RAII
307 evhttp_add_header(output_headers, "User-Agent", ("dash-json-rpc/" + FormatFullVersion()).c_str());
333 else if (response.nStatus >= 400 && response.nStatus != HTTP_BAD_REQUEST && response.nStatus != HTTP_NOT_FOUND && response.nStatus != HTTP_INTERNAL_SERVER_ERROR)
359 LogPrint(BCLog::KEEPASS, "CKeePassIntegrator::rpcTestAssociation -- send result: status: %d response: %s\n", nStatus, strResponse);
379 LogPrint(BCLog::KEEPASS, "CKeePassIntegrator::rpcGetLogins -- send result: status: %d\n", nStatus);
404 void CKeePassIntegrator::rpcSetLogin(const SecureString& sWalletPass, const SecureString& sEntryId)
430 LogPrint(BCLog::KEEPASS, "CKeePassIntegrator::rpcSetLogin -- send result: status: %d response: %s\n", nStatus, strResponse);
473 LogPrint(BCLog::KEEPASS, "CKeePassIntegrator::rpcAssociate -- send result: status: %d response: %s\n", nStatus, strResponse);
505 throw std::runtime_error("keepasskey parameter is not defined. Please specify the configuration parameter.");
509 throw std::runtime_error("keepassid parameter is not defined. Please specify the configuration parameter.");
513 throw std::runtime_error("keepassname parameter is not defined. Please specify the configuration parameter.");
522 throw std::runtime_error("KeePassHttp returned 0 matches, please verify the keepassurl setting.");
538 throw std::runtime_error("keepasskey parameter is not defined. Please specify the configuration parameter.");
542 throw std::runtime_error("keepassid parameter is not defined. Please specify the configuration parameter.");
546 throw std::runtime_error("keepassname parameter is not defined. Please specify the configuration parameter.");
void parseResponse(const std::string &strResponse)
Definition: keepass.cpp:156
void addStrParameter(const std::string &strName, const std::string &strValue)
Definition: keepass.cpp:123
Definition: keepass.h:88
std::vector< unsigned char > DecodeBase64(const char *p, bool *pfInvalid)
Definition: utilstrencodings.cpp:177
void updatePassphrase(const SecureString &sWalletPassphrase)
Definition: keepass.cpp:533
Definition: protocol.h:22
Definition: protocol.h:25
bool EncryptAES256(const SecureString &sKey, const SecureString &sPlaintext, const std::string &sIV, std::string &sCiphertext)
Definition: crypter.cpp:123
static const unsigned int DEFAULT_KEEPASS_HTTP_PORT
Definition: keepass.h:14
SecureString EncodeBase64Secure(const SecureString &sInput)
Definition: keepass.cpp:65
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
Definition: secure.h:57
Definition: univalue.h:20
void GetStrongRandBytes(unsigned char *out, int num)
Function to gather random data from multiple sources, failing whenever any of those source fail to pr...
Definition: random.cpp:317
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
Definition: util.cpp:824
std::vector< CKeePassEntry > getEntries()
Definition: keepass.cpp:205
bool DecryptAES256(const SecureString &sKey, const std::string &sCiphertext, const std::string &sIV, SecureString &sPlaintext)
Definition: crypter.cpp:155
void rpcAssociate(std::string &strIdRet, SecureString &sKeyBase64Ret)
Definition: keepass.cpp:460
static SecureString generateKeePassKey()
Definition: keepass.cpp:453
static const int KEEPASS_CRYPTO_BLOCK_SIZE
Definition: keepass.h:21
SecureString DecodeBase64Secure(const SecureString &sInput)
Definition: keepass.cpp:36
Definition: keepass.h:18
static void http_request_done(struct evhttp_request *req, void *ctx)
Definition: keepass.cpp:261
Definition: univalue.h:22
Definition: keepass.h:57
static const int KEEPASS_CRYPTO_KEY_SIZE
Definition: keepass.h:20
static std::pair< std::string, UniValue > Pair(const char *cKey, const char *cVal)
Definition: univalue.h:185
void doHTTPPost(const std::string &strRequest, int &nStatusRet, std::string &strResponseRet)
Definition: keepass.cpp:287
Definition: protocol.h:27
static const int KEEPASS_HTTP_CONNECT_TIMEOUT
Definition: keepass.h:22
SecureString getSecureStr(const std::string &strName)
Definition: keepass.cpp:177
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
Definition: util.cpp:808
static SecureString generateRandomKey(size_t nSize)
Definition: keepass.cpp:225
SecureString decrypt(const std::string &strValue)
Definition: keepass.cpp:194
Definition: util.h:136
void rpcTestAssociation(bool bTriggerUnlock)
Definition: keepass.cpp:349
std::vector< CKeePassEntry > rpcGetLogins()
Definition: keepass.cpp:362
void rpcSetLogin(const SecureString &sWalletPass, const SecureString &sEntryId)
Definition: keepass.cpp:404
static std::string constructHTTPPost(const std::string &strMsg, const std::map< std::string, std::string > &mapRequestHeaders)
Definition: keepass.cpp:237
std::string EncodeBase64(const unsigned char *pch, size_t len)
Definition: utilstrencodings.cpp:126
Definition: keepass.h:34
std::string getStr(const std::string &strName)
Definition: keepass.cpp:172