mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-23 02:25:40 +08:00
char * / unsigned char * conversions fixed
This commit is contained in:
parent
fb4ab5d07f
commit
94dfa195db
12
src/tlspr.c
12
src/tlspr.c
@ -38,7 +38,7 @@ int readtls(struct clientparam *param, int direction, unsigned char *buf, int bu
|
|||||||
#define PROTOLEN (32)
|
#define PROTOLEN (32)
|
||||||
|
|
||||||
|
|
||||||
int parsehello(int type, unsigned char *hello, int len, unsigned char *sni, int *lv, unsigned char * proto){
|
int parsehello(int type, unsigned char *hello, int len, char *sni, int *lv, char * proto){
|
||||||
int hlen;
|
int hlen;
|
||||||
unsigned offset;
|
unsigned offset;
|
||||||
int slen;
|
int slen;
|
||||||
@ -174,10 +174,10 @@ int tlstobufsrv(struct clientparam *param, int offset){
|
|||||||
|
|
||||||
void * tlsprchild(struct clientparam* param) {
|
void * tlsprchild(struct clientparam* param) {
|
||||||
int res;
|
int res;
|
||||||
unsigned char sni[SNILEN];
|
char sni[SNILEN];
|
||||||
char req[SNILEN+PROTOLEN+16];
|
char req[SNILEN+PROTOLEN+16];
|
||||||
int lv=-1;
|
int lv=-1;
|
||||||
unsigned char proto[PROTOLEN]="-";
|
char proto[PROTOLEN]="-";
|
||||||
|
|
||||||
res = tlstobufcli(param, 0);
|
res = tlstobufcli(param, 0);
|
||||||
if(res <= 0 || param->clibuf[0] != 22){
|
if(res <= 0 || param->clibuf[0] != 22){
|
||||||
@ -192,7 +192,7 @@ void * tlsprchild(struct clientparam* param) {
|
|||||||
param->hostname = NULL;
|
param->hostname = NULL;
|
||||||
}
|
}
|
||||||
else if (parsehostname(sni, param, param->srv->targetport? param->srv->targetport:443)) RETURN (100);
|
else if (parsehostname(sni, param, param->srv->targetport? param->srv->targetport:443)) RETURN (100);
|
||||||
if (!param->hostname)param->hostname = mystrdup((char *)sni);
|
if (!param->hostname)param->hostname = (unsigned char *)mystrdup(sni);
|
||||||
}
|
}
|
||||||
else if (res < 0 && param->srv->requirecert) RETURN(310-res);
|
else if (res < 0 && param->srv->requirecert) RETURN(310-res);
|
||||||
}
|
}
|
||||||
@ -274,8 +274,8 @@ void * tlsprchild(struct clientparam* param) {
|
|||||||
RETURN (mapsocket(param, conf.timeouts[CONNECTION_L]));
|
RETURN (mapsocket(param, conf.timeouts[CONNECTION_L]));
|
||||||
CLEANRET:
|
CLEANRET:
|
||||||
|
|
||||||
sprintf(req, "%sv%d.%d %s %s", lv<0?"NONE":lv?"TLS":"SSL", lv<0?0:lv?1:3, lv<0?0:lv?lv-1:0, param->hostname?param->hostname:"-", proto);
|
sprintf(req, "%sv%d.%d %s %s", lv<0?"NONE":lv?"TLS":"SSL", lv<0?0:lv?1:3, lv<0?0:lv?lv-1:0, param->hostname?(char *)param->hostname:"-", proto);
|
||||||
dolog(param, req);
|
dolog(param, (unsigned char *)req);
|
||||||
freeparam(param);
|
freeparam(param);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user