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

Side by Side Diff: net/ntlm/md4.cc

Issue 2873673002: Add unit tests for NTLMv1 portable implementation (Closed)
Patch Set: Rebase 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 unified diff | Download patch
« no previous file with comments | « net/ntlm/md4.h ('k') | net/ntlm/ntlm.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // This is mozilla/security/manager/ssl/src/md4.c, CVS rev. 1.1, with trivial 1 // This is mozilla/security/manager/ssl/src/md4.c, CVS rev. 1.1, with trivial
2 // changes to port it to our source tree. 2 // changes to port it to our source tree.
3 // 3 //
4 // WARNING: MD4 is cryptographically weak. Do not use MD4 except in NTLM 4 // WARNING: MD4 is cryptographically weak. Do not use MD4 except in NTLM
5 // authentication. 5 // authentication.
6 6
7 /* clang-format off */
7 /* vim:set ts=2 sw=2 et cindent: */ 8 /* vim:set ts=2 sw=2 et cindent: */
8 /* ***** BEGIN LICENSE BLOCK ***** 9 /* ***** BEGIN LICENSE BLOCK *****
9 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
10 * 11 *
11 * The contents of this file are subject to the Mozilla Public License Version 12 * The contents of this file are subject to the Mozilla Public License Version
12 * 1.1 (the "License"); you may not use this file except in compliance with 13 * 1.1 (the "License"); you may not use this file except in compliance with
13 * the License. You may obtain a copy of the License at 14 * the License. You may obtain a copy of the License at
14 * http://www.mozilla.org/MPL/ 15 * http://www.mozilla.org/MPL/
15 * 16 *
16 * Software distributed under the License is distributed on an "AS IS" basis, 17 * Software distributed under the License is distributed on an "AS IS" basis,
(...skipping 21 matching lines...) Expand all
38 * and other provisions required by the GPL or the LGPL. If you do not delete 39 * and other provisions required by the GPL or the LGPL. If you do not delete
39 * the provisions above, a recipient may use your version of this file under 40 * the provisions above, a recipient may use your version of this file under
40 * the terms of any one of the MPL, the GPL or the LGPL. 41 * the terms of any one of the MPL, the GPL or the LGPL.
41 * 42 *
42 * ***** END LICENSE BLOCK ***** */ 43 * ***** END LICENSE BLOCK ***** */
43 44
44 /* 45 /*
45 * "clean room" MD4 implementation (see RFC 1320) 46 * "clean room" MD4 implementation (see RFC 1320)
46 */ 47 */
47 48
48 #include "net/http/md4.h" 49 #include "net/ntlm/md4.h"
49 50
50 #include <string.h> 51 #include <string.h>
51 52
52 typedef uint32_t Uint32; 53 typedef uint32_t Uint32;
53 typedef uint8_t Uint8; 54 typedef uint8_t Uint8;
54 55
55 /* the "conditional" function */ 56 /* the "conditional" function */
56 #define F(x,y,z) (((x) & (y)) | (~(x) & (z))) 57 #define F(x,y,z) (((x) & (y)) | (~(x) & (z)))
57 58
58 /* the "majority" function */ 59 /* the "majority" function */
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 md4step(state, final); 176 md4step(state, final);
176 if (n >= 56) 177 if (n >= 56)
177 md4step(state, final + 64); 178 md4step(state, final + 64);
178 179
179 /* copy state to result */ 180 /* copy state to result */
180 w2b(result, state, 16); 181 w2b(result, state, 16);
181 } 182 }
182 183
183 } // namespace weak_crypto 184 } // namespace weak_crypto
184 } // namespace net 185 } // namespace net
OLDNEW
« no previous file with comments | « net/ntlm/md4.h ('k') | net/ntlm/ntlm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698