gpo: Test certificate policy without NDES
commit0d1ff69936f18ea729fc11fbbb1569a833302572
authorGabriel Nagy <gabriel.nagy@canonical.com>
Mon, 8 Jan 2024 16:05:08 +0000 (8 18:05 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 22 Jan 2024 15:41:36 +0000 (22 15:41 +0000)
tree124f949bb6555d7b20b13392cfd52f251ada529c
parent2713023250f15cf9971d88620cab9dd4afd0dc73
gpo: Test certificate policy without NDES

As of 8231eaf856b, the NDES feature is no longer required on Windows, as
cert auto-enroll can use the certificate from the LDAP request.

However, 157335ee93e changed the implementation to convert the LDAP
certificate to base64 due to it failing to cleanly convert to a string.

Because of insufficient test coverage I missed handling the part where
NDES is disabled or not reachable and the LDAP certificate was imported.
The call to load_der_x509_certificate now fails with an error because it
expects binary data, yet it receives a base64 encoded string.

This adds a test to confirm the issue.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15557

Signed-off-by: Gabriel Nagy <gabriel.nagy@canonical.com>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
python/samba/tests/gpo.py
selftest/knownfail.d/gpo [new file with mode: 0644]