Re: [Dillo-dev]cookies dpi over https and dpi framework
Hello, i have found that the problem was in https dpi. Under some circunstances, self signed certificate and formated in some way, the https dpi died. I send a patch to fix it. The patch is for dillo 0.8.5 but surely it works in previous versions, only touches dpi/https.c, it works with or without cookies.dpi patch, whitout cokies.dpi patch only the first dillo have cookies. I send a this mail with cc to the list to make it,the new(and the fix), public so the people can test it ASAP. Diego Sáenz/DarkSpirit. 8<--------------------CUT HERE------------------>8 diff -pru dillo-0.8.5-DIRTY/dpi/https.c dillo-0.8.5-WORK/dpi/https.c --- dillo-0.8.5-DIRTY/dpi/https.c 2005-07-03 23:25:06.000000000 +0200 +++ dillo-0.8.5-WORK/dpi/https.c 2005-07-03 23:29:23.000000000 +0200 @@ -331,6 +331,7 @@ static int handle_certificate_problem(SS int retval = -1; long st; char buf[4096]; + char * cn, * cn_end; X509 * remote_cert; @@ -363,12 +364,16 @@ static int handle_certificate_problem(SS case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: /*Either self signed and untrusted*/ /*Extract CN from certificate name information*/ - strncpy(buf, (strstr(remote_cert->name, "/CN=") + 4), - (size_t)(strstr(strstr(remote_cert->name, "/CN=") + 4, "/") - - strstr(remote_cert->name, "/CN=")- 4)); + cn = strstr(remote_cert->name, "/CN=") + 4; + if (cn == NULL) break; + + if ((cn_end = strstr(cn, "/")) == NULL ) cn_end = cn + strlen(cn); + + strncpy(buf, cn, (size_t) (cn_end - cn)); + /*Add terminating NULL*/ - buf[strstr(strstr(remote_cert->name, "/CN=") + 4, "/") - - strstr(remote_cert->name, "/CN=")- 3] = 0; + buf[cn_end - cn] = 0; + sock_handler_printf(sh, 1, "<dpi cmd='dialog' msg='%s%s' alt1='%s' alt2='%s' alt3='%s'>", "The remote certificate is self-signed and untrusted.\n" 8<----------------------CUT HERE------------------------>8 El Tue, 28 Jun 2005 00:13:24 +0200 Jorgen Viksell <jviksell@dillo.org> escribio:
OK, now it's up at: https://www.dillo.org/~jviksell/test.php http://www.dillo.org/~jviksell/test.php
It sends four secure cookies and four unsecure.
Cheers, Jörgen
participants (1)
-
Diego Sáenz