From: Andreas Schneider Date: Wed, 27 Nov 2024 09:15:45 +0000 (+0100) Subject: python: Fix length of Common Name x509 attribute X-Git-Tag: tdb-1.4.13~472 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6c619c77c9bab8b659b8bffc21c3b9303c1566f2;p=thirdparty%2Fsamba.git python: Fix length of Common Name x509 attribute File "bin/python/samba/tests/krb5/pkinit_tests.py", line 1496, in create_certificate x509.NameAttribute(NameOID.COMMON_NAME, ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^ f'{cert_name}/emailAddress={cert_name}'), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.13/site-packages/cryptography/x509/name.py", line 152, in __init__ raise ValueError(msg) ValueError: Attribute's length must be >= 1 and <= 64, but it was 84 Signed-off-by: Andreas Schneider Reviewed-by: Stefan Metzmacher --- diff --git a/python/samba/tests/krb5/pkinit_tests.py b/python/samba/tests/krb5/pkinit_tests.py index dbd158b2dc2..5278d4945cf 100755 --- a/python/samba/tests/krb5/pkinit_tests.py +++ b/python/samba/tests/krb5/pkinit_tests.py @@ -1493,8 +1493,7 @@ class PkInitTests(KDCBaseTest): x509.NameAttribute(NameOID.STATE_OR_PROVINCE_NAME, 'SambaState'), x509.NameAttribute(NameOID.ORGANIZATION_NAME, 'SambaSelfTesting'), x509.NameAttribute(NameOID.ORGANIZATIONAL_UNIT_NAME, 'Users'), - x509.NameAttribute(NameOID.COMMON_NAME, - f'{cert_name}/emailAddress={cert_name}'), + x509.NameAttribute(NameOID.COMMON_NAME, f'{cert_name}'), ])) # The new certificate must be issued by the root CA.