1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-20 22:50:26 +03:00

tests/krb5: Expect e-data except when the error code is KDC_ERR_GENERIC

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14817
(cherry picked from commit 8194b2a2611c6b1db2d29ec22c70e14decd1784b)
This commit is contained in:
Joseph Sutton 2021-07-28 17:00:09 +12:00 committed by Jule Anger
parent 1676812b85
commit c562c5cbee
2 changed files with 3 additions and 1 deletions

View File

@ -40,6 +40,7 @@ from samba.tests import TestCaseInTempDir
import samba.tests.krb5.rfc4120_pyasn1 as krb5_asn1
from samba.tests.krb5.rfc4120_constants import (
KDC_ERR_ETYPE_NOSUPP,
KDC_ERR_GENERIC,
KDC_ERR_PREAUTH_REQUIRED,
KRB_AP_REQ,
KRB_AS_REP,
@ -1799,7 +1800,7 @@ class RawKerberosTest(TestCaseInTempDir):
self.assertElementEqualPrincipal(rep, 'sname', expected_sname)
if self.strict_checking:
self.assertElementMissing(rep, 'e-text')
if expected_error_mode != KDC_ERR_PREAUTH_REQUIRED:
if expected_error_mode == KDC_ERR_GENERIC:
self.assertElementMissing(rep, 'e-data')
return
edata = self.getElementValue(rep, 'e-data')

View File

@ -58,6 +58,7 @@ KDC_ERR_PREAUTH_FAILED = 24
KDC_ERR_PREAUTH_REQUIRED = 25
KDC_ERR_BADMATCH = 36
KDC_ERR_SKEW = 37
KDC_ERR_GENERIC = 60
# Name types
NT_UNKNOWN = int(krb5_asn1.NameTypeValues('kRB5-NT-UNKNOWN'))