Skip to content

Commit 665ba57

Browse files
committed
Remove signature check download()
1 parent a75f868 commit 665ba57

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

auth.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -986,25 +986,6 @@ std::vector<unsigned char> KeyAuth::api::download(std::string fileid) {
986986
auto json = response_decoder.parse(response);
987987
std::string message = json[(XorStr("message"))];
988988

989-
// from https://github.com/h5p9sl/hmac_sha256
990-
std::stringstream ss_result;
991-
992-
// Allocate memory for the HMAC
993-
std::vector<uint8_t> out(SHA256_HASH_SIZE);
994-
995-
// Call hmac-sha256 function
996-
hmac_sha256(enckey.data(), enckey.size(), response.data(), response.size(),
997-
out.data(), out.size());
998-
999-
// Convert `out` to string with std::hex
1000-
for (uint8_t x : out) {
1001-
ss_result << std::hex << std::setfill('0') << std::setw(2) << (int)x;
1002-
}
1003-
1004-
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), sizeof(signature).c_str())) { // check response authenticity, if not authentic program crashes
1005-
error("Signature checksum failed. Request was tampered with or session ended most likely. & echo: & echo Message: " + message);
1006-
}
1007-
1008989
load_response_data(json);
1009990
if (json[ XorStr( "success" ) ])
1010991
{

0 commit comments

Comments
 (0)