Skip to content

fix(ldap.controls): decode DNs as UTF-8 in response controls - #673

Open
spaceone wants to merge 2 commits into
mainfrom
fix/647-control-str-bytes-confusion
Open

spaceone wants to merge 2 commits into
mainfrom
fix/647-control-str-bytes-confusion

Conversation

@spaceone

Copy link
Copy Markdown
Contributor

Use explicit UTF-8 decoding for DNs instead of pyasn1 OctetString string conversion, which will decode as ISO8859-1.

This is a leftover from the Python 3 migration as there was always str() wrappping, which was a bytes-string in Python 2 but since Python 3 that was implicitly decoded by pyasn.

Issue: #647
Issue: #647

Use explicit UTF-8 decoding for DNs instead of pyasn1 OctetString string conversion,
which will decode as ISO8859-1.

This is a leftover from the Python 3 migration as there was always str()
wrappping, which was a bytes-string in Python 2 but since Python 3 that
was implicitly decoded by pyasn.

Issue: #647
Issue: #647
@spaceone
spaceone force-pushed the fix/647-control-str-bytes-confusion branch from 64a3f49 to 63b5ff5 Compare October 17, 2026 14:28
Encode attribute types and ordering rules as ASCII bytes before
passing them to pyasn1, ensuring consistent encoding and rejecting
invalid non-ASCII identifiers.

Issue: #647
Issue: #647

@droideck droideck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. But I think it'll be nice for @mistotebe to check too.

@spaceone spaceone added this to the 3.5.0 milestone Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants