Bug 421634: Don't send an SNI Client Hello extension bearing an IPv6 address
r=wtc,julien.pierre git-svn-id: svn://10.0.0.236/trunk@254543 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
f08cd3f86b
commit
172499bfd0
@ -41,7 +41,7 @@
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/* TLS extension code moved here from ssl3ecc.c */
|
||||
/* $Id: ssl3ext.c,v 1.2 2008-03-06 20:16:22 wtc%google.com Exp $ */
|
||||
/* $Id: ssl3ext.c,v 1.3 2008-10-06 22:04:15 nelson%bolyard.com Exp $ */
|
||||
|
||||
#include "nssrenam.h"
|
||||
#include "nss.h"
|
||||
@ -291,17 +291,18 @@ ssl3_SendServerNameXtn(
|
||||
PRBool append,
|
||||
PRUint32 maxBytes)
|
||||
{
|
||||
PRUint32 len, span;
|
||||
PRUint32 len;
|
||||
PRNetAddr netAddr;
|
||||
|
||||
/* must have a hostname */
|
||||
if (!ss || !ss->url || !ss->url[0])
|
||||
return 0;
|
||||
/* must have at lest one character other than [0-9\.] */
|
||||
len = PORT_Strlen(ss->url);
|
||||
span = strspn(ss->url, "0123456789.");
|
||||
if (len == span) {
|
||||
/* is a dotted decimal IP address */
|
||||
return 0;
|
||||
/* must not be an IPv4 or IPv6 address */
|
||||
if (PR_SUCCESS == PR_StringToNetAddr(ss->url, &netAddr)) {
|
||||
/* is an IP address (v4 or v6) */
|
||||
return 0;
|
||||
}
|
||||
len = PORT_Strlen(ss->url);
|
||||
if (append && maxBytes >= len + 9) {
|
||||
SECStatus rv;
|
||||
/* extension_type */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user