Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(811)

Unified Diff: net/ntlm/des.cc

Issue 2873673002: Add unit tests for NTLMv1 portable implementation (Closed)
Patch Set: Merge build config back to net Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/ntlm/des.cc
diff --git a/net/http/des.cc b/net/ntlm/des.cc
similarity index 93%
rename from net/http/des.cc
rename to net/ntlm/des.cc
index 57f67d7c51f81e3fe76c690e499ee8f9aa1cdb04..7f69299952fd09b657550245bacd54760c096599 100644
--- a/net/http/des.cc
+++ b/net/ntlm/des.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "net/http/des.h"
+#include "net/ntlm/des.h"
#include "base/logging.h"
#include "crypto/openssl_util.h"
@@ -50,9 +50,9 @@
// Set odd parity bit (in least significant bit position).
static uint8_t DESSetKeyParity(uint8_t x) {
- if ((((x >> 7) ^ (x >> 6) ^ (x >> 5) ^
- (x >> 4) ^ (x >> 3) ^ (x >> 2) ^
- (x >> 1)) & 0x01) == 0) {
+ if ((((x >> 7) ^ (x >> 6) ^ (x >> 5) ^ (x >> 4) ^ (x >> 3) ^ (x >> 2) ^
+ (x >> 1)) &
+ 0x01) == 0) {
x |= 0x01;
} else {
x &= 0xfe;
@@ -77,8 +77,7 @@ void DESEncrypt(const uint8_t* key, const uint8_t* src, uint8_t* hash) {
crypto::EnsureOpenSSLInit();
DES_key_schedule ks;
- DES_set_key(
- reinterpret_cast<const DES_cblock*>(key), &ks);
+ DES_set_key(reinterpret_cast<const DES_cblock*>(key), &ks);
DES_ecb_encrypt(reinterpret_cast<const DES_cblock*>(src),
reinterpret_cast<DES_cblock*>(hash), &ks, DES_ENCRYPT);

Powered by Google App Engine
This is Rietveld 408576698