diff options
author | George Hazan <george.hazan@gmail.com> | 2013-02-12 20:44:55 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-02-12 20:44:55 +0000 |
commit | 82016434fff2eb8ed8288c0c45bc76a67574860d (patch) | |
tree | f0771b2391899c61960c27af13d5e046f0d087d2 /plugins/YAMN/src/proto/pop3/pop3.cpp | |
parent | c989c00ce9e0a8422e7efb3c21350ca3f5276d86 (diff) |
- fix for chinese in popups;
- own md5 module removed;
- version bump;
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@3585 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/YAMN/src/proto/pop3/pop3.cpp')
-rw-r--r-- | plugins/YAMN/src/proto/pop3/pop3.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/plugins/YAMN/src/proto/pop3/pop3.cpp b/plugins/YAMN/src/proto/pop3/pop3.cpp index 76c3e9645c..bae04363cb 100644 --- a/plugins/YAMN/src/proto/pop3/pop3.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3.cpp @@ -28,10 +28,6 @@ #include "..\..\yamn.h" #include "pop3.h" -extern "C" { -#include "../md5.h" -} - extern void __stdcall SSL_DebugLog( const char *fmt, ... ); //-------------------------------------------------------------------------------------------------- @@ -47,7 +43,7 @@ char *CPop3Client::Connect(const char* servername,const int port,BOOL UseSSL, BO if (Stopped) //check if we can work with this POP3 client session throw POP3Error=(DWORD)EPOP3_STOPPED; - if (NetClient!=NULL) + if (NetClient != NULL) delete NetClient; SSL=UseSSL; NetClient=new CNLClient; @@ -114,7 +110,7 @@ char* CPop3Client::RecvRest(char* prev,int mode,int size) { //if not found if (NetClient->Stopped) //check if we can work with this POP3 client session { - if (PrevString!=NULL) + if (PrevString != NULL) free(PrevString); throw POP3Error=(DWORD)EPOP3_STOPPED; } @@ -252,13 +248,13 @@ char* CPop3Client::APOP(char* name, char* pw, char* timestamp) if (timestamp==NULL) throw POP3Error=(DWORD)EPOP3_APOP; - MD5Context ctx; - MD5Init(&ctx); - MD5Update(&ctx,(const unsigned char *)timestamp,(unsigned int)strlen(timestamp)); - MD5Update(&ctx,(const unsigned char *)pw,(unsigned int)strlen(pw)); - MD5Final(digest,&ctx); + mir_md5_state_s ctx; + mir_md5_init(&ctx); + mir_md5_append(&ctx,(const unsigned char *)timestamp,(unsigned int)strlen(timestamp)); + mir_md5_append(&ctx,(const unsigned char *)pw,(unsigned int)strlen(pw)); + mir_md5_finish(&ctx, digest); hexdigest[0]='\0'; - for (int i=0; i<16; i++) { + for (int i=0; i < 16; i++) { char tmp[4]; sprintf(tmp, "%02x", digest[i]); strcat(hexdigest, tmp); |