pike.git
/
lib
/
modules
/
Crypto.pmod
/
testsuite.in
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Crypto.pmod/testsuite.in:1231:
aes_cbc->set_decrypt_key(String.hex2string("0"*32)); aes_cbc->set_iv(String.hex2string("0"*32)); string ct = String.hex2string("0"*32); for(int i = 0; i < 10000; i++) { ct = aes_cbc->crypt(ct); } return ct; ]], [[ String.hex2string("FACA37E0B0C85373DF706E73F7C9AF86") ]]) ]])
+
// NTLM
+
+
// Hash for NULL password taken from https://en.wikipedia.org/wiki/LM_hash
+
test_eq( Crypto.NTLM.LMOWFv1("", "", ""),
+
H("AAD3B435B51404EEAAD3B435B51404EE") )
+
+
// [MS-NLMP] 4.2.2.1.1:
+
test_eq( Crypto.NTLM.LMOWFv1("Password", "User", "Domain"),
+
H("e5 2c ac 67 41 9a 9a 22 4a 3b 10 8f 3f a6 cb 6d") )
+
+
// [MS-NLMP] 4.2.2.1.2
+
test_eq( Crypto.NTLM.NTOWFv1("Password", "User", "Domain"),
+
H("a4 f4 9c 40 65 10 bd ca b6 82 4e e7 c3 0f d8 52") )
+
+
// [MS-NLMP] 4.2.2.1.3
+
test_eq( Crypto.NTLM.SBKv1("Password", "User", "Domain"),
+
H("d8 72 62 b0 cd e4 b1 cb 74 99 be cc cd f1 07 84") )
+
+
// [MN-NLMP] 4.2.4.1.1
+
test-eq( Crypto.NTLM.NTOWFv2("Password", "User", "Domain"),
+
H("0c 86 8a 40 3b fd 7a 93 a3 00 1e f2 2e f0 2e 3f") )
+
test-eq( Crypto.NTLM.LMOWFv2("Password", "User", "Domain"),
+
H("0c 86 8a 40 3b fd 7a 93 a3 00 1e f2 2e f0 2e 3f") )
+
test_do( add_constant( "H" ) ) test_do( add_constant( "S" ) ) test_do([[ int pwtest(string p, void|string s) { return Crypto.Password.verify( p, Crypto.Password.hash(p, s) ); }; add_constant( "P", pwtest ); ]]) test_true( P("hej") )