]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python:tests: Don't require an emtpy 'authorization-data' to be present
authorAndreas Schneider <asn@samba.org>
Thu, 16 Dec 2021 06:24:58 +0000 (07:24 +0100)
committerJoseph Sutton <jsutton@samba.org>
Mon, 20 Dec 2021 08:26:45 +0000 (08:26 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Autobuild-User(master): Joseph Sutton <jsutton@samba.org>
Autobuild-Date(master): Mon Dec 20 08:26:45 UTC 2021 on sn-devel-184

python/samba/tests/krb5/raw_testcase.py

index d11f628d7b67c6cb922ec815c6acf5f88f8d10dd..8b6eec3c40d064ece7631172156ac59541519400 100644 (file)
@@ -2490,8 +2490,19 @@ class RawKerberosTest(TestCaseInTempDir):
             if self.strict_checking:
                 self.assertElementEqual(ticket_private, 'caddr', [])
             if expect_pac is not None:
-                self.assertElementPresent(ticket_private, 'authorization-data',
-                                          expect_empty=not expect_pac)
+                if expect_pac:
+                    self.assertElementPresent(ticket_private,
+                                              'authorization-data',
+                                              expect_empty=not expect_pac)
+                else:
+                    # It is more correct to not have an authorization-data
+                    # present than an empty one.
+                    #
+                    # https://github.com/krb5/krb5/pull/1225#issuecomment-995104193
+                    v = self.getElementValue(ticket_private,
+                                             'authorization-data')
+                    if v is not None:
+                        self.assertEqual(0, len(v))
 
         encpart_session_key = None
         if encpart_private is not None: