- if (proto_version >= 1202)
- {
- hmac2.append(challenge);
- std::string hmac = sha256->hexsum(hmac1 + sha256->sum(hmac2));
-
- return "AUTH:" + hmac;
- }
- else
- {
- // version 1.2 used a weaker HMAC, using hex output in the intermediate step
- hmac2.append(challenge);
- hmac2 = sha256->hexsum(hmac2);
-
- std::string hmac = hmac1 + hmac2;
- hmac = sha256->hexsum(hmac);
-
- return "HMAC-SHA256:"+ hmac;
- }
- }
- else if (!challenge.empty() && !sha256)
- ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Not authenticating to server using SHA256/HMAC because we don't have m_sha256 loaded!");
+ if (!challenge.empty() && !sha256)
+ ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Not authenticating to server using SHA256/HMAC because we don't have an SHA256 provider (e.g. m_sha256) loaded!");