From: Joseph Sutton Date: Wed, 20 Dec 2023 03:39:14 +0000 (+1300) Subject: tests/krb5: Raise an error if root key data is the wrong length X-Git-Tag: talloc-2.4.2~188 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d280fac8690eb6985ce477f3f9bb6e5faf3256d;p=thirdparty%2Fsamba.git tests/krb5: Raise an error if root key data is the wrong length Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/gkdi.py b/python/samba/tests/gkdi.py index 53b49a31556..623e0e5e092 100644 --- a/python/samba/tests/gkdi.py +++ b/python/samba/tests/gkdi.py @@ -218,6 +218,13 @@ class GkdiBaseTest(TestCase): self.assertIsNotNone(root_key_cn) root_key_id = misc.GUID(root_key_cn) + data = root_key_object.get("msKds-RootKeyData", idx=0) + self.assertIsNotNone(data) + if len(data) != KEY_LEN_BYTES: + raise GetKeyError( + HRES_NTE_BAD_KEY, f"root key data must be {KEY_LEN_BYTES} bytes" + ) + use_start_nt_time = NtTime( int(root_key_object.get("msKds-UseStartTime", idx=0)) )