summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-03-03 14:52:21 +0000
committerKristian Monsen <kristianm@google.com>2011-03-03 17:44:36 +0000
commite00741fe4b5b3d04d95b48b19d56c94fc9bc0237 (patch)
tree98761e396ab2a42c50fd9893188c806d29133376 /net
parent8db08726a8eea9d32f637ced774aac6b16416071 (diff)
downloadexternal_chromium-e00741fe4b5b3d04d95b48b19d56c94fc9bc0237.zip
external_chromium-e00741fe4b5b3d04d95b48b19d56c94fc9bc0237.tar.gz
external_chromium-e00741fe4b5b3d04d95b48b19d56c94fc9bc0237.tar.bz2
Fix for bug 2386130 VZW:PP659: login issues on some sites:http://traffic.cumulus.com - LIBtt61764 (NTLM support) do not merge
Tested with the test site from the bug. Looks like it works! Cherry picked from master Change-Id: I795128a1c50d10e8c23d9d5fb70362853355485d
Diffstat (limited to 'net')
-rw-r--r--net/http/des.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/net/http/des.cc b/net/http/des.cc
index 943f612..5d87f31 100644
--- a/net/http/des.cc
+++ b/net/http/des.cc
@@ -10,6 +10,8 @@
#include <nss.h>
#include <pk11pub.h>
#include "base/nss_util.h"
+#elif defined(USE_OPENSSL)
+#include <openssl/des.h>
#elif defined(OS_MACOSX)
#include <CommonCrypto/CommonCryptor.h>
#elif defined(OS_WIN)
@@ -87,8 +89,14 @@ void DESMakeKey(const uint8* raw, uint8* key) {
#if defined(USE_OPENSSL)
void DESEncrypt(const uint8* key, const uint8* src, uint8* hash) {
- // TODO(joth): When implementing consider splitting up this file by platform.
- NOTIMPLEMENTED();
+ DES_cblock des_key;
+ DES_key_schedule schedule;
+
+ memcpy(des_key, key, 8);
+ DES_set_odd_parity(&des_key);
+ DES_set_key_checked(&des_key, &schedule);
+
+ DES_ecb_encrypt((C_Block *)src, (C_Block *)hash, &schedule, DES_ENCRYPT);
}
#elif defined(USE_NSS)
@@ -206,14 +214,6 @@ void DESEncrypt(const uint8* key, const uint8* src, uint8* hash) {
}
}
-#elif defined(USE_OPENSSL) && defined(ANDROID)
-
-// To be implemented with openssl
-void DESEncrypt(const uint8* key, const uint8* src, uint8* hash) {
- int* a = NULL;
- int c = *a;
-}
-
#endif
} // namespace net