From 8933dfc4ce0d95d92bab0b1c62b86c615e42544e Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 18 Mar 2016 12:40:25 +0100 Subject: [PATCH] Logging moved to cryptographic classes --- UpdCheck/main.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/UpdCheck/main.cpp b/UpdCheck/main.cpp index 15ec45f..10095a7 100644 --- a/UpdCheck/main.cpp +++ b/UpdCheck/main.cpp @@ -73,10 +73,8 @@ int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In // Create RSA AES cryptographic context. wxCryptoSessionRSAAES cs; - if (!cs.IsOk()) { - wxLogError(wxT("Failed to create cryptographics session.")); + if (!cs.IsOk()) return -1; - } // Import public key. wxCryptoKey ck; @@ -86,10 +84,8 @@ int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In HGLOBAL res_handle = ::LoadResource(NULL, res); wxASSERT_MSG(res_handle, wxT("loading resource failed")); - if (!ck.ImportPublic(cs, ::LockResource(res_handle), ::SizeofResource(NULL, res))) { - wxLogError(wxT("Failed to import public key.")); + if (!ck.ImportPublic(cs, ::LockResource(res_handle), ::SizeofResource(NULL, res))) return -1; - } } for (const wxChar *server = wxT(UPDATER_HTTP_SERVER); server[0]; server += wcslen(server) + 1) { @@ -156,10 +152,8 @@ int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In // Hash the content. wxCryptoHashSHA1 ch(cs); - if (!wxXmlHashNode(ch, document)) { - wxLogWarning(wxT("Failed to hash the repository catalogue.")); + if (!wxXmlHashNode(ch, document)) continue; - } // We have the hash, we have the signature, we have the public key. Now verify. if (!wxCryptoVerifySignature(ch, sig.data(), sig.size(), ck)) {