feat(Core/Crypto): add support OpenSSL 3.0 (#13354)

This commit is contained in:
Winfidonarleyan
2022-11-23 21:12:20 +03:00
committed by GitHub
parent 4a2964e10a
commit a1a1528cb4
37 changed files with 1099 additions and 507 deletions

View File

@@ -28,11 +28,8 @@ static constexpr uint32 HMAC_RESULT_SIZE = 20;
{
timestamp /= TOTP_INTERVAL;
unsigned char challenge[8];
for (int i = 8; i--; timestamp >>= 8)
{
challenge[i] = timestamp;
}
unsigned char digest[HMAC_RESULT_SIZE];
uint32 digestSize = HMAC_RESULT_SIZE;
@@ -41,7 +38,6 @@ static constexpr uint32 HMAC_RESULT_SIZE = 20;
uint32 offset = digest[19] & 0xF;
uint32 truncated = (digest[offset] << 24) | (digest[offset + 1] << 16) | (digest[offset + 2] << 8) | (digest[offset + 3]);
truncated &= 0x7FFFFFFF;
return (truncated % 1000000);
}