summaryrefslogtreecommitdiff
path: root/protocols/MSN/src/skylogin/uic.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2020-04-07 22:57:27 +0300
committerdartraiden <wowemuh@gmail.com>2020-04-07 22:57:44 +0300
commit71cfe74d3618c15feab24032c7d4cd71d77129af (patch)
tree7b3e5fcababe16ce26b8b8bfc8591d9732e2cb33 /protocols/MSN/src/skylogin/uic.c
parent559cc9efdc9fbc5d3da5edaaf24924e0cc57a20d (diff)
MSN: moved to deprecated, banned, removed support from plugins, etc
Diffstat (limited to 'protocols/MSN/src/skylogin/uic.c')
-rw-r--r--protocols/MSN/src/skylogin/uic.c105
1 files changed, 0 insertions, 105 deletions
diff --git a/protocols/MSN/src/skylogin/uic.c b/protocols/MSN/src/skylogin/uic.c
deleted file mode 100644
index 6b32b70796..0000000000
--- a/protocols/MSN/src/skylogin/uic.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Skype Login
- *
- * Based on:
- * FakeSkype : Skype reverse engineering proof-of-concept client
- * Ouanilo MEDEGAN (c) 2006 http://www.oklabs.net
- * pyskype : Skype login Python script by uunicorn
- *
- * Written by: leecher@dose.0wnz.at (c) 2015
- *
- * Module: UIC generation
- *
- */
-#include "common.h"
-#include "random.h"
-#include "skylogin.h"
-
-#ifndef CRYPT_WOLFSSL
-/* OpenSSL Base64_Encode */
-#include <openssl/evp.h>
-#include <openssl/buffer.h>
-
-static int Base64_Encode(const uchar* in, uint inLen, uchar* out, uint* outLen)
-{
- BIO *bmem, *b64;
- BUF_MEM *bptr;
- int ret=0;
-
- b64 = BIO_new(BIO_f_base64());
- bmem = BIO_new(BIO_s_mem());
- b64 = BIO_push(b64, bmem);
- BIO_write(b64, in, inLen);
- BIO_flush(b64);
- BIO_get_mem_ptr(b64, &bptr);
- if (*outLen>(uint)bptr->length) *outLen=bptr->length; else ret=-1;
- memcpy(out, bptr->data, *outLen);
- BIO_free_all(b64);
- return ret;
-}
-#endif
-
-
-Memory_U CreateUIC(Skype_Inst *pInst, const char *pszNonce, const char *pszSalt)
-{
- Memory_U uic_pkt, uic={0};
- SHA_CTX CredCtx;
- uchar *p;
- uchar SignedChallenge[0x80] = {0};
- int cbSalt = strlen(pszSalt), cbNonce = strlen(pszNonce);
-
- if (!(uic_pkt.Memory = (uchar*)malloc(uic_pkt.MsZ = SHA_DIGEST_LENGTH + cbSalt + cbNonce)))
- return uic;
- SHA1_Init(&CredCtx);
- SHA1_Update(&CredCtx, pInst->LoginD.SignedCredentials.Memory, pInst->LoginD.SignedCredentials.MsZ);
- SHA1_Update(&CredCtx, pszSalt, cbSalt);
- SHA1_Final(uic_pkt.Memory, &CredCtx);
- p = uic_pkt.Memory + SHA_DIGEST_LENGTH;
- memcpy(p, pszSalt, cbSalt);
- p+=cbSalt;
- memcpy(p, pszNonce, cbNonce);
- BuildUnFinalizedDatas(uic_pkt.Memory, uic_pkt.MsZ, SignedChallenge);
- if (RSA_private_encrypt(sizeof(SignedChallenge), SignedChallenge, SignedChallenge,
- pInst->LoginD.RSAKeys, RSA_NO_PADDING)<0)
- return uic;
- free (uic_pkt.Memory);
- if (!(uic.Memory = (uchar*)malloc(uic.MsZ = sizeof(SignedChallenge) + pInst->LoginD.SignedCredentials.MsZ + 4)))
- {
- uic.MsZ=0;
- return uic;
- }
- p = uic.Memory;
- *((uint*)p) = htonl(pInst->LoginD.SignedCredentials.MsZ);
- p+=sizeof(uint);
- memcpy(p, pInst->LoginD.SignedCredentials.Memory, pInst->LoginD.SignedCredentials.MsZ);
- p+=pInst->LoginD.SignedCredentials.MsZ;
- memcpy(p, SignedChallenge, sizeof(SignedChallenge));
- return uic;
-}
-
-
-int CreateUICString(Skype_Inst *pInst, const char *pszNonce, const char *pszSalt, char *pszOutUIC)
-{
- Memory_U uic = CreateUIC(pInst, pszNonce, pszSalt);
- uint outlen = UICSTR_SIZE;
-
- if (uic.MsZ && uic.Memory)
- {
- Base64_Encode(uic.Memory, uic.MsZ, (uchar*)pszOutUIC, &outlen);
- pszOutUIC[outlen]=0;
- free(uic.Memory);
- } else return 0;
- return outlen;
-}
-
-int GetCredentialsUIC(Skype_Inst *pInst, char *pszOutUIC)
-{
- uint outlen = UICSTR_SIZE;
-
- if (pInst->LoginD.SignedCredentials.MsZ)
- {
- Base64_Encode(pInst->LoginD.SignedCredentials.Memory, pInst->LoginD.SignedCredentials.MsZ, (uchar*)pszOutUIC, &outlen);
- pszOutUIC[outlen]=0;
- } else return 0;
- return outlen;
-}