summaryrefslogtreecommitdiffstats
path: root/netwerk
diff options
context:
space:
mode:
Diffstat (limited to 'netwerk')
-rw-r--r--netwerk/protocol/http/nsHttpConnectionInfo.cpp22
-rw-r--r--netwerk/socket/nsSOCKSIOLayer.cpp1
2 files changed, 9 insertions, 14 deletions
diff --git a/netwerk/protocol/http/nsHttpConnectionInfo.cpp b/netwerk/protocol/http/nsHttpConnectionInfo.cpp
index e965fd1cc..93a40843c 100644
--- a/netwerk/protocol/http/nsHttpConnectionInfo.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionInfo.cpp
@@ -15,32 +15,26 @@
#include "nsHttpConnectionInfo.h"
#include "mozilla/net/DNS.h"
-#include "prnetdb.h"
-#include "nsICryptoHash.h"
#include "nsComponentManagerUtils.h"
+#include "nsICryptoHash.h"
#include "nsIProtocolProxyService.h"
+#include "nsNetCID.h"
+#include "prnetdb.h"
static nsresult
SHA256(const char* aPlainText, nsAutoCString& aResult)
{
- static nsICryptoHash* hasher = nullptr;
nsresult rv;
- if (!hasher) {
- rv = CallCreateInstance("@mozilla.org/security/hash;1", &hasher);
- if (NS_FAILED(rv)) {
- LOG(("nsHttpDigestAuth: no crypto hash!\n"));
- return rv;
- }
+ nsCOMPtr<nsICryptoHash> hasher = do_CreateInstance(NS_CRYPTO_HASH_CONTRACTID, &rv);
+ if (NS_FAILED(rv)) {
+ LOG(("nsHttpDigestAuth: no crypto hash!\n"));
+ return rv;
}
-
rv = hasher->Init(nsICryptoHash::SHA256);
NS_ENSURE_SUCCESS(rv, rv);
-
rv = hasher->Update((unsigned char*) aPlainText, strlen(aPlainText));
NS_ENSURE_SUCCESS(rv, rv);
-
- rv = hasher->Finish(false, aResult);
- return rv;
+ return hasher->Finish(false, aResult);
}
namespace mozilla {
diff --git a/netwerk/socket/nsSOCKSIOLayer.cpp b/netwerk/socket/nsSOCKSIOLayer.cpp
index 22f5751fb..5429637c1 100644
--- a/netwerk/socket/nsSOCKSIOLayer.cpp
+++ b/netwerk/socket/nsSOCKSIOLayer.cpp
@@ -229,6 +229,7 @@ nsSOCKSSocketInfo::nsSOCKSSocketInfo()
, mDataLength(0)
, mReadOffset(0)
, mAmountToRead(0)
+ , mFD(nullptr)
, mVersion(-1)
, mDestinationFamily(AF_INET)
, mFlags(0)