Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for empty attribute values #397

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lionello
Copy link
Contributor

Per RFC 2253 attribute values can be empty:

attributeTypeAndValue = attributeType "=" attributeValue

attributeType = (ALPHA 1*keychar) / oid
keychar    = ALPHA / DIGIT / "-"

oid        = 1*DIGIT *("." 1*DIGIT)

attributeValue = string

string     = *( stringchar / pair )
             / "#" hexstring
             / QUOTATION *( quotechar / pair ) QUOTATION ; only from v2

where * is 0-or-more and 1* is 1-or-more.

In addition to fixing the AttributeTypeValue regex, to allow creation of a X500Name by object with empty string value, I call RDN.addByString as opposed to using the constructor (which parses multi-valued RDN strings which setByObject would never get).

This also addresses a breaking change introduced in 6.2.1 for values that have + in them: these suddenly got parsed as multi-value attributes.

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.

None yet

1 participant