From 9d51f3049b9d1daa4c94bc7d5bdb49c776fae0d3 Mon Sep 17 00:00:00 2001 From: Eion Robb Date: Tue, 16 Feb 2016 19:20:03 +1300 Subject: Fix for bad function calls in win32 RSA functions --- steam-mobile/steam_rsa.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/steam-mobile/steam_rsa.c b/steam-mobile/steam_rsa.c index 2f74d8b..767bcd4 100644 --- a/steam-mobile/steam_rsa.c +++ b/steam-mobile/steam_rsa.c @@ -447,13 +447,14 @@ steam_encrypt_password(const gchar *modulus_str, const gchar *exponent_str, cons return NULL; } - DWORD dataSize = (DWORD)strlen(password); - DWORD encryptedSize; + DWORD dataSize = strlen(password); + DWORD encryptedSize = dataSize; // get length of encrypted data - if (!CryptEncrypt(phKey, 0, TRUE, 0, NULL, &encryptedSize, dataSize)) + if (!CryptEncrypt(phKey, 0, TRUE, 0, NULL, &encryptedSize, 0)) { - purple_debug_error("steam", "password encryption failed, couldnt get length of RSA, error=%d\n", GetLastError()); + gint errorno = GetLastError(); + purple_debug_error("steam", "password encryption failed, couldnt get length of RSA, error=%d %s\n", errorno, g_win32_error_message(errorno)); free(pKeyBlob); free(pbBuffer); -- cgit v1.2.3