From: Nick Porter Date: Fri, 29 Mar 2024 10:21:47 +0000 (+0000) Subject: Add MSCHAPv2 to tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b5d174e375d2d8ec3b178a803ed302e3dce5912;p=thirdparty%2Ffreeradius-server.git Add MSCHAPv2 to tests --- diff --git a/src/tests/modules/mschap/auth_mschapv2.attrs b/src/tests/modules/mschap/auth_mschapv2.attrs new file mode 100644 index 00000000000..1c102dad4e4 --- /dev/null +++ b/src/tests/modules/mschap/auth_mschapv2.attrs @@ -0,0 +1,17 @@ +# +# Input Packet +# +Packet-Type = Access-Request +User-Name = 'example\john' +NAS-IP-Address = 127.0.0.1 +Vendor-Specific.Microsoft.CHAP-Challenge = 0x16d2833f4239256dd2b2bb26f2ecb2a3 +Vendor-Specific.Microsoft.CHAP2-Response = 0x0001502feeee9495a353cddbd1efc40072820000000000000000e866286bb30d0215ed16cf425b6a29d206667a9853e23ca4 + +# +# Expected answer +# +Packet-Type == Access-Accept +Vendor-Specific.Microsoft.CHAP2-Success == 0x00533d36383634394236373633333031444436354643323535394632443137323934333139364541383841 +Vendor-Specific.Microsoft.MPPE-Encryption-Policy == Encryption-Allowed +Vendor-Specific.Microsoft.MPPE-Encryption-Types == RC4-40or128-bit-Allowed + diff --git a/src/tests/modules/mschap/auth_mschapv2.unlang b/src/tests/modules/mschap/auth_mschapv2.unlang new file mode 100644 index 00000000000..801ad145b98 --- /dev/null +++ b/src/tests/modules/mschap/auth_mschapv2.unlang @@ -0,0 +1,22 @@ +&control.Password.Cleartext := "secret" + +mschap + +if !(&control.Auth-Type == mschap) { + test_fail +} + +mschap.authenticate + +if !(&reply.Vendor-Specific.Microsoft.MPPE-Send-Key) { + test_fail +} + +if !(&reply.Vendor-Specific.Microsoft.MPPE-Recv-Key) { + test_fail +} + +&reply -= &Vendor-Specific.Microsoft.MPPE-Send-Key +&reply -= &Vendor-Specific.Microsoft.MPPE-Recv-Key + +test_pass