Advertisement
Guest User

patch-ff20-bug633001

a guest
Apr 12th, 2013
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. --- security/manager/boot/src/nsStrictTransportSecurityService.cpp.orig 2013-03-27 06:18:01.000000000 +0800
  2. +++ security/manager/boot/src/nsStrictTransportSecurityService.cpp 2013-04-11 17:49:25.000000000 +0800
  3. @@ -5,6 +5,7 @@
  4. #include "plstr.h"
  5. #include "prlog.h"
  6. #include "prprf.h"
  7. +#include "prnetdb.h"
  8. #include "nsCRTGlue.h"
  9. #include "nsIPermissionManager.h"
  10. #include "nsISSLStatus.h"
  11. @@ -363,11 +364,17 @@
  12. // manager is used and it's not threadsafe.
  13. NS_ENSURE_TRUE(NS_IsMainThread(), NS_ERROR_UNEXPECTED);
  14.  
  15. + // Create a dummy URI, and then set the host in order to get proper handling
  16. + // of eg. IPv6 literals.
  17. nsCOMPtr<nsIURI> uri;
  18. nsDependentCString hostString(aHost);
  19. nsresult rv = NS_NewURI(getter_AddRefs(uri),
  20. - NS_LITERAL_CSTRING("https://") + hostString);
  21. + NS_LITERAL_CSTRING("https://dummyhost.example.org"));
  22. NS_ENSURE_SUCCESS(rv, rv);
  23. +
  24. + rv = uri->SetHost(hostString);
  25. + NS_ENSURE_SUCCESS(rv, rv);
  26. +
  27. return IsStsURI(uri, aFlags, aResult);
  28. }
  29.  
  30. @@ -417,6 +424,11 @@
  31. nsresult rv = GetHost(aURI, host);
  32. NS_ENSURE_SUCCESS(rv, rv);
  33.  
  34. + PRNetAddr hostAddr;
  35. + if (PR_StringToNetAddr(host.BeginReading(), &hostAddr) == PR_SUCCESS) {
  36. + return NS_OK;
  37. + }
  38. +
  39. const nsSTSPreload *preload = nullptr;
  40. nsSTSHostEntry *pbEntry = nullptr;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement