summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Boukris <iboukris@gmail.com>2019-11-19 19:10:18 +0100
committerAndrew Bartlett <abartlet@samba.org>2019-12-10 00:30:30 +0000
commite2f8f686d1e3fce91f10aadb9667854cf2a1219a (patch)
tree38bbb3dab007897b4ea6f02b3c889b7afc69bc70
parent8f042ba532fc645f2389a0a9d3e83d27c070fde4 (diff)
downloadsamba-e2f8f686d1e3fce91f10aadb9667854cf2a1219a.tar.gz
selftest: test des_crypt128
Signed-off-by: Isaac Boukris <iboukris@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--libcli/auth/tests/test_gnutls.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libcli/auth/tests/test_gnutls.c b/libcli/auth/tests/test_gnutls.c
index 1e6f8dd5b5b..b1129db14c9 100644
--- a/libcli/auth/tests/test_gnutls.c
+++ b/libcli/auth/tests/test_gnutls.c
@@ -332,6 +332,25 @@ static void torture_gnutls_E_old_pw_hash(void **state)
assert_memory_equal(crypt, crypt_expected, 16);
}
+static void torture_gnutls_des_crypt128(void **state)
+{
+ static uint8_t key[16] = {
+ 0x98, 0xFD, 0xCB, 0x3A, 0xF7, 0xB5, 0x1C, 0xF8,
+ 0xA9, 0x69, 0x88, 0x96, 0x8E, 0xB5, 0x3A, 0x24
+ };
+ static const uint8_t clear[8] = {
+ 0x3F, 0x49, 0x5B, 0x20, 0xA7, 0x84, 0xC2, 0x34
+ };
+ static const uint8_t crypt_expected[8] = {
+ 0x4C, 0xB4, 0x4B, 0xD3, 0xC8, 0xC1, 0xA5, 0x50
+ };
+
+ uint8_t crypt[8];
+
+ des_crypt128(crypt, clear, key);
+ assert_memory_equal(crypt, crypt_expected, 8);
+}
+
static void torture_gnutls_sam_rid_crypt(void **state)
{
static const uint8_t clear[16] = {
@@ -364,6 +383,7 @@ int main(int argc, char *argv[])
cmocka_unit_test(torture_gnutls_E_P24),
cmocka_unit_test(torture_gnutls_SMBOWFencrypt),
cmocka_unit_test(torture_gnutls_E_old_pw_hash),
+ cmocka_unit_test(torture_gnutls_des_crypt128),
cmocka_unit_test(torture_gnutls_sam_rid_crypt),
};