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

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

Issue 2873673002: Add unit tests for NTLMv1 portable implementation (Closed)
Patch Set: Review feedback 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
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 /* vim:set ts=2 sw=2 et cindent: */ 7 /* vim:set ts=2 sw=2 et cindent: */
8 /* ***** BEGIN LICENSE BLOCK ***** 8 /* ***** BEGIN LICENSE BLOCK *****
9 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 9 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
10 * 10 *
(...skipping 27 matching lines...) Expand all
38 * and other provisions required by the GPL or the LGPL. If you do not delete 38 * 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 39 * 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. 40 * the terms of any one of the MPL, the GPL or the LGPL.
41 * 41 *
42 * ***** END LICENSE BLOCK ***** */ 42 * ***** END LICENSE BLOCK ***** */
43 43
44 /* 44 /*
45 * "clean room" MD4 implementation (see RFC 1320) 45 * "clean room" MD4 implementation (see RFC 1320)
46 */ 46 */
47 47
48 #include "net/http/md4.h" 48 #include "net/ntlm/md4.h"
49 49
50 #include <string.h> 50 #include <string.h>
51 51
52 /* clang-format off */
Ryan Sleevi 2017/07/13 17:39:54 I would move this to line 6
zentaro 2017/07/13 18:20:31 Done.
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 */
59 #define G(x,y,z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) 60 #define G(x,y,z) (((x) & (y)) | ((x) & (z)) | ((y) & (z)))
60 61
61 /* the "parity" function */ 62 /* the "parity" function */
(...skipping 113 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

Powered by Google App Engine
This is Rietveld 408576698