Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- security/manager/boot/src/nsStrictTransportSecurityService.cpp.orig 2013-03-27 06:18:01.000000000 +0800
- +++ security/manager/boot/src/nsStrictTransportSecurityService.cpp 2013-04-11 17:49:25.000000000 +0800
- @@ -5,6 +5,7 @@
- #include "plstr.h"
- #include "prlog.h"
- #include "prprf.h"
- +#include "prnetdb.h"
- #include "nsCRTGlue.h"
- #include "nsIPermissionManager.h"
- #include "nsISSLStatus.h"
- @@ -363,11 +364,17 @@
- // manager is used and it's not threadsafe.
- NS_ENSURE_TRUE(NS_IsMainThread(), NS_ERROR_UNEXPECTED);
- + // Create a dummy URI, and then set the host in order to get proper handling
- + // of eg. IPv6 literals.
- nsCOMPtr<nsIURI> uri;
- nsDependentCString hostString(aHost);
- nsresult rv = NS_NewURI(getter_AddRefs(uri),
- - NS_LITERAL_CSTRING("https://") + hostString);
- + NS_LITERAL_CSTRING("https://dummyhost.example.org"));
- NS_ENSURE_SUCCESS(rv, rv);
- +
- + rv = uri->SetHost(hostString);
- + NS_ENSURE_SUCCESS(rv, rv);
- +
- return IsStsURI(uri, aFlags, aResult);
- }
- @@ -417,6 +424,11 @@
- nsresult rv = GetHost(aURI, host);
- NS_ENSURE_SUCCESS(rv, rv);
- + PRNetAddr hostAddr;
- + if (PR_StringToNetAddr(host.BeginReading(), &hostAddr) == PR_SUCCESS) {
- + return NS_OK;
- + }
- +
- const nsSTSPreload *preload = nullptr;
- nsSTSHostEntry *pbEntry = nullptr;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement