Bug 674670 - openssl loses base64 data if no newline at the end
Summary: openssl loses base64 data if no newline at the end
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: openssl
Version: 14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Mraz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-02 21:17 UTC by Penelope Fudd
Modified: 2011-07-26 10:50 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-26 10:50:23 UTC
Type: ---


Attachments (Terms of Use)

Description Penelope Fudd 2011-02-02 21:17:03 UTC
Description of problem:
I'm testing smtp auth login using the command line.  One step is to encode the username and password with "/bin/echo -ne myusername | openssl enc -base64".  The opposite step would be "/bin/echo -ne bXl1c2VybmFtZQ== | openssl enc -d -base64", which doesn't actually produce any output until you remove the '-ne'.

Version-Release number of selected component (if applicable):
openssl-1.0.0c-1.fc14.i686

How reproducible:
Every time

Steps to Reproduce:
1. /bin/echo -ne bXl1c2VybmFtZQ== | openssl enc -d -base64
2.
3.
  
Actual results:
No output

Expected results:
The string 'myusername' should be printed, with no newline.

Additional info:
I got the method from 
http://goodingredients.org/recipe/articles/email3/smtp-testing.rst

Side note: the built-in echo in tcsh doesn't recognize the '-ne', and sends it to stdout.  That caused some frustration until I tried decoding it and the base64 spelled out "-ne myusername".  For testing, use /bin/echo or bash's echo, not tcsh echo.

Comment 1 Penelope Fudd 2011-02-02 21:19:16 UTC
To clarify: openssl doesn't process (ie: throws away) the base64 string unless there's a newline on the end.  I don't recall any spec saying that newlines were required before base64 is valid.

Comment 2 Tomas Mraz 2011-02-02 21:43:44 UTC
You can use the plain base64 command from coreutils that works.

Can you please report the bug upstream by sending it to the upstream bug tracker rt?


Note You need to log in before you can comment on or make changes to this bug.