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

RFC 2849 Base64 newlines should start with " " #413

Closed
sebi-hgdata opened this issue Jul 13, 2016 · 1 comment
Closed

RFC 2849 Base64 newlines should start with " " #413

sebi-hgdata opened this issue Jul 13, 2016 · 1 comment
Assignees
Milestone

Comments

@sebi-hgdata
Copy link

Printing to ldif format is done by calling the toString() method on LdapAttributes, it in turn, for base64 values, will call https://github.com/spring-projects/spring-ldap/blob/master/core/src/main/java/org/springframework/ldap/support/LdapEncoder.java#L247.
For long values the ldif format asks a ' ' (space) at the beginning of the lines.

At line https://github.com/spring-projects/spring-ldap/blob/master/core/src/main/java/org/springframework/ldap/support/LdapEncoder.java#L260 a space needs to be added after \n

@rwinch
Copy link
Member

rwinch commented Sep 30, 2016

Thanks for the report. More specifically this is what RFC 2849 has to say:

Any non-empty line, including comment lines, in an LDIF file
MAY be folded by inserting a line separator (SEP) and a SPACE.
Folding MUST NOT occur before the first character of the line.
In other words, folding a line into two lines, the first of
which is empty, is not permitted. Any line that begins with a
single space MUST be treated as a continuation of the previous
(non-empty) line. When joining folded lines, exactly one space
character at the beginning of each continued line must be
discarded. Implementations SHOULD NOT fold lines in the middle
of a multi-byte UTF-8 character.

@rwinch rwinch self-assigned this Sep 30, 2016
@rwinch rwinch added this to the 2.2.0.RC1 milestone Sep 30, 2016
@rwinch rwinch added the bug label Sep 30, 2016
@rwinch rwinch changed the title Issue printing long base64 values to ldif format RFC 2849 Base64 newlines should start with " " Sep 30, 2016
@rwinch rwinch closed this as completed in 1e542f3 Sep 30, 2016
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

No branches or pull requests

2 participants