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

b64_decode_cacerts: accept non-wrapped input #114

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

Conversation

frasertweedale
Copy link

@frasertweedale frasertweedale commented Jun 14, 2022

BIO_f_base64 either requires wrapped base64 with a short
initial line, or when BIO_FLAGS_BASE64_NO_NL is set, all data
must be on a single line (with or without trailing newline
character). See BIO_f_base64(3ossl) for more details.

RFC 8951 (an update to RFC 7030) clarifies that senders are
not required to insert white space (such as LF) in
base64-encoded payloads. Therefore libest must handle
wrapped or unwrapped base64 with lines of any length.

This leaves two options:

  1. set BIO_FLAGS_BASE64_NO_NL and unwrap the input lines

  2. leave the flag unset but split long lines and ensure the
    input ends with a newline.

Option 1 is simpler so that's what this commit implements.

@frasertweedale frasertweedale marked this pull request as draft June 14, 2022 04:30
`BIO_f_base64` either requires wrapped base64 with a short
initial line, or when `BIO_FLAGS_BASE64_NO_NL` is set, all data
must be on a single line (with or without trailing newline
character).  See `BIO_f_base64(3ossl)` for more details.

RFC 8951 (an update to RFC 7030) clarifies that senders are
not required to insert white space (such as LF) in
base64-encoded payloads.  Therefore libest must handle
wrapped or unwrapped base64 with lines of any length.

This leaves two options:

1. set `BIO_FLAGS_BASE64_NO_NL` and unwrap the input lines

2. leave the flag unset but split long lines and ensure the
   input ends with a newline.

Option 1 is simpler so that's what this commit implements.

Signed-off-by: Fraser Tweedale <[email protected]>
@frasertweedale frasertweedale marked this pull request as ready for review June 15, 2022 04:03
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.

1 participant