summaryrefslogtreecommitdiff
path: root/protocols/Skype
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-11-11 14:49:21 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-11-11 14:49:21 +0000
commit8d17151c9e3500082f61f43fc0eee065ba794df8 (patch)
treeb613183b109917d6612cf14f3ada8a79d2bbca9a /protocols/Skype
parente2d3722cccb735f101ca8955d050cc1cc82ecf1c (diff)
original key don't included in clear
git-svn-id: http://svn.miranda-ng.org/main/trunk@2290 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype')
-rw-r--r--protocols/Skype/keypacker/keypacker.cpp15
-rw-r--r--protocols/Skype/keypacker/stdafx.h2
-rw-r--r--protocols/Skype/src/skype.cpp9
3 files changed, 24 insertions, 2 deletions
diff --git a/protocols/Skype/keypacker/keypacker.cpp b/protocols/Skype/keypacker/keypacker.cpp
index 6aa5b3e0c0..117fa20f93 100644
--- a/protocols/Skype/keypacker/keypacker.cpp
+++ b/protocols/Skype/keypacker/keypacker.cpp
@@ -147,6 +147,21 @@ int main()
aes_context ctx;
FILE *fin, *fout;
+ int t = strlen(MY_KEY);
+ int basecodedkey = encodeLength(strlen(MY_KEY), false);
+ buf = malloc(basecodedkey + 1);
+ unsigned char *tmpk = (unsigned char *)malloc(basecodedkey + 1);
+ tmpk = (unsigned char *)encode((unsigned char*)MY_KEY, strlen(MY_KEY), false);
+ tmpk[basecodedkey] = 0;
+ char *output = (char*)malloc(basecodedkey + 17);
+ strcpy(output, "#define MY_KEY \"");
+ strcat(output, (const char*)tmpk);
+ strcat(output, "\"");
+ fout = fopen("..\\..\\..\\..\\SkypeKit\\key.h", "wb");
+ fputs((const char*)output, fout);
+ fclose(fout);
+ free(buf);
+
aes_set_key( &ctx, (BYTE*)MY_KEY, 128);
//encrypt
diff --git a/protocols/Skype/keypacker/stdafx.h b/protocols/Skype/keypacker/stdafx.h
index 4bd30a212f..d63a19340e 100644
--- a/protocols/Skype/keypacker/stdafx.h
+++ b/protocols/Skype/keypacker/stdafx.h
@@ -5,4 +5,4 @@ extern "C"
{
#include "..\src\aes\aes.h"
}
-#include "..\..\..\..\SkypeKit\key.h"
+#include "..\..\..\..\SkypeKit\original_key.h"
diff --git a/protocols/Skype/src/skype.cpp b/protocols/Skype/src/skype.cpp
index d8428b9b6a..ec2ab96e92 100644
--- a/protocols/Skype/src/skype.cpp
+++ b/protocols/Skype/src/skype.cpp
@@ -141,7 +141,14 @@ char* LoadKeyPair()
HGLOBAL hResource = LoadResource(g_hInstance, hRes);
if (hResource) {
aes_context ctx;
- aes_set_key( &ctx, (BYTE*)MY_KEY, 128);
+
+ int basedecodedkey = decodeSize((char*)MY_KEY);
+ unsigned char *tmpK = (unsigned char*)malloc(basedecodedkey + 1);
+ decode((char*)MY_KEY, tmpK, basedecodedkey);
+ tmpK[basedecodedkey] = 0;
+
+
+ aes_set_key( &ctx, tmpK, 128);
int dwResSize = SizeofResource(g_hInstance, hRes);
char *pData = (char*)GlobalLock(hResource);
pData[dwResSize] = 0;