X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=x11fwd.c;h=6cfec72824304b8e853802b599c12ed932802a91;hb=9f9d72ec58642e91b4f93ee4405a8086ee2fb2f0;hp=4a6d82704b7cdbccbed5a1dfcf964aaa2dda9cbd;hpb=a53e4e2cb6aa5b953fa0cdbef3b1702d0925f195;p=PuTTY.git diff --git a/x11fwd.c b/x11fwd.c index 4a6d8270..6cfec728 100644 --- a/x11fwd.c +++ b/x11fwd.c @@ -357,10 +357,10 @@ void x11_free_display(struct X11Display *disp) #define XDM_MAXSKEW 20*60 /* 20 minute clock skew should be OK */ -static char *x11_verify(unsigned long peer_ip, int peer_port, - tree234 *authtree, char *proto, - unsigned char *data, int dlen, - struct X11FakeAuth **auth_ret) +static const char *x11_verify(unsigned long peer_ip, int peer_port, + tree234 *authtree, char *proto, + unsigned char *data, int dlen, + struct X11FakeAuth **auth_ret) { struct X11FakeAuth match_dummy; /* for passing to find234 */ struct X11FakeAuth *auth; @@ -420,7 +420,8 @@ static char *x11_verify(unsigned long peer_ip, int peer_port, if (data[i] != 0) /* zero padding wrong */ return "XDM-AUTHORIZATION-1 data failed check"; tim = time(NULL); - if (abs(t - tim) > XDM_MAXSKEW) + if (((unsigned long)t - (unsigned long)tim + + XDM_MAXSKEW) > 2*XDM_MAXSKEW) return "XDM-AUTHORIZATION-1 time stamp was too far out"; seen = snew(struct XDMSeen); seen->time = t;