Skip to content

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 force-pushed the fix/b64-handle-unwrapped branch from da64fef to 5d03478 Compare June 15, 2022 04:02
@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