mirror of
https://github.com/3proxy/3proxy.git
synced 2026-06-15 12:00:10 +08:00
Compare commits
No commits in common. "0d7f05b05b3a8247c63bcc99173eea00b39c0eb6" and "ff7f4b8ea6e21d931b2c56f2e4cfb04a98aba45b" have entirely different histories.
0d7f05b05b
...
ff7f4b8ea6
@ -118,6 +118,7 @@ unsigned char * mycrypt(const unsigned char *pw, const unsigned char *salt, unsi
|
||||
EVP_DigestUpdate(ctx1,sp,sl);
|
||||
EVP_DigestUpdate(ctx1,pw,strlen((char *)pw));
|
||||
EVP_DigestFinal_ex(ctx1,final,&len);
|
||||
EVP_MD_CTX_free(ctx1);
|
||||
for(pl = (int)strlen((char *)pw); pl > 0; pl -= MD5_SIZE)
|
||||
EVP_DigestUpdate(ctx,final,pl>MD5_SIZE ? MD5_SIZE : pl);
|
||||
|
||||
@ -141,7 +142,7 @@ unsigned char * mycrypt(const unsigned char *pw, const unsigned char *salt, unsi
|
||||
* need 30 seconds to build a 1000 entry dictionary...
|
||||
*/
|
||||
for(i=0;i<1000;i++) {
|
||||
EVP_MD_CTX_reset(ctx1);
|
||||
ctx1 = EVP_MD_CTX_new();
|
||||
EVP_DigestInit_ex(ctx1, md5, NULL);
|
||||
if(i & 1)
|
||||
EVP_DigestUpdate(ctx1,pw,strlen((char *)pw));
|
||||
@ -159,9 +160,13 @@ unsigned char * mycrypt(const unsigned char *pw, const unsigned char *salt, unsi
|
||||
else
|
||||
EVP_DigestUpdate(ctx1,pw,strlen((char *)pw));
|
||||
EVP_DigestFinal_ex(ctx1,final,&len);
|
||||
}
|
||||
EVP_MD_CTX_free(ctx1);
|
||||
}
|
||||
|
||||
|
||||
/* Don't leave anything around in vm they could use. */
|
||||
memset(final,0,sizeof final);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if(salt[0] == '$' && salt[1] == '3' && salt[2] == '$' && (ep = (unsigned char *)strchr((char *)salt+3, '$'))) {
|
||||
|
||||
@ -194,6 +194,7 @@ static int h_proxy(int argc, unsigned char ** argv){
|
||||
childdef.port = 3128;
|
||||
childdef.isudp = 0;
|
||||
childdef.service = S_PROXY;
|
||||
childdef.helpmessage = " -n - no NTLM support\n";
|
||||
#ifdef NOIPV6
|
||||
if(!resolvfunc || (resolvfunc == myresolver && !dns_table.poolsize)){
|
||||
fprintf(stderr, "[line %d] Warning: no nserver/nscache configured, proxy may run very slow\n", linenum);
|
||||
@ -226,6 +227,7 @@ static int h_proxy(int argc, unsigned char ** argv){
|
||||
childdef.port = 1080;
|
||||
childdef.isudp = 0;
|
||||
childdef.service = S_SOCKS;
|
||||
childdef.helpmessage = " -n - no NTLM support\n";
|
||||
#ifdef NOIPV6
|
||||
if(!resolvfunc || (resolvfunc == myresolver && !dns_table.poolsize)){
|
||||
fprintf(stderr, "[line %d] Warning: no nserver/nscache configured, socks may run very slow\n", linenum);
|
||||
|
||||
@ -417,10 +417,6 @@ for(;;){
|
||||
c = *se;
|
||||
*se = 0;
|
||||
}
|
||||
if(param->hostname && (!*param->hostname || isnumber(param->hostname[strlen((char *)param->hostname) - 1]))){
|
||||
free(param->hostname);
|
||||
param->hostname = NULL;
|
||||
}
|
||||
if(!param->hostname){
|
||||
if(parsehostname((char *)sb, param, 80)) RETURN(100);
|
||||
}
|
||||
|
||||
@ -456,12 +456,12 @@ int MODULEMAINFUNC (int argc, char** argv){
|
||||
else if(argv[i][3] == 'i') getip46(46, (unsigned char *)argv[i]+3, (struct sockaddr *)&srv.intNat);
|
||||
else getip46(46, (unsigned char *)argv[i]+2, (struct sockaddr *)&srv.extNat);
|
||||
break;
|
||||
case 'n':
|
||||
#ifdef __linux__
|
||||
case 'n':
|
||||
if(argv[i][2] == 'i') { if(srv.inetns) free(srv.inetns); srv.inetns = strdup(argv[i] + 3); }
|
||||
else if(argv[i][2] == 'e') { if(srv.onetns) free(srv.onetns); srv.onetns = strdup(argv[i] + 3); }
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
case 'p':
|
||||
*SAPORT(&srv.intsa) = htons(atoi(argv[i]+2));
|
||||
break;
|
||||
|
||||
@ -111,11 +111,6 @@ int udpsockmap(struct clientparam *param, int timeo)
|
||||
memcmp(SAADDR(&sin), SAADDR(¶m->sincr), SAADDRLEN(&sin)))
|
||||
continue;
|
||||
if (firstpacket) {
|
||||
if (!SAISNULL(¶m->req) && *SAPORT(¶m->req) &&
|
||||
SAADDRLEN(¶m->req) == SAADDRLEN(&sin) &&
|
||||
!memcmp(SAADDR(¶m->req), SAADDR(&sin), SAADDRLEN(¶m->req)) &&
|
||||
memcmp(SAPORT(¶m->req), SAPORT(&sin), 2))
|
||||
continue;
|
||||
param->sincr = sin;
|
||||
firstpacket = 0;
|
||||
} else if (memcmp(SAPORT(&sin), SAPORT(¶m->sincr), 2)) {
|
||||
@ -189,6 +184,13 @@ int udpsockmap(struct clientparam *param, int timeo)
|
||||
memcmp(SAPORT(&from), SAPORT(¶m->sinsr), 2))
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (!SAISNULL(¶m->req) && *SAPORT(¶m->req)) {
|
||||
if (SAADDRLEN(&from) != SAADDRLEN(¶m->req) ||
|
||||
memcmp(SAADDR(&from), SAADDR(¶m->req), SAADDRLEN(&from)) ||
|
||||
memcmp(SAPORT(&from), SAPORT(¶m->req), 2))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
param->statssrv64 += len;
|
||||
param->nreads++;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user