Base64 decoding bug - outputs the file name to stdout.

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Base64 decoding bug - outputs the file name to stdout.

Simon McMahon

Two commands give different output to decode a b64 encoded EXE file as follows:

1. "openssl base64 -d -in file.txt -out file.exe"

     Operates as expected. The original file is produced.

2. "openssl base64 -d -in file.txt > file.exe"

     Outputs the name of the file and then the decoded data. The EXE file appears corrupt but just has some leading bytes that are the file's name.

In my opinion the result should be the same in both cases, especially if openssl is to be used to do stream encodings. Maybe it works if its a pipe but it should just be the same output in all cases.

Obviously I just fixed my problem by using method 1 instead of 2 but if behaviour 2 is not necessary then maybe it should be dropped so as not to be a trap for the unwary.

Note: Platform Windows XP, openssl-0.9.7g.



Simon McMahon

Work: (07) 31311420
Mobile: (043) 2294180

This email, including any attachments sent with it, is confidential and for the sole use of the intended recipient(s).  This confidentiality is not waived or lost, if you receive it and you are not the intended recipient(s), or if it is transmitted/received in error.

Any unauthorised use, alteration, disclosure, distribution or review of this email is prohibited.  It may be subject to a statutory duty of confidentiality if it relates to health service matters.

If you are not the intended recipient(s), or if you have received this email in error, you are asked to immediately notify the sender by telephone or by return email.  You should also delete this email and destroy any hard copies produced.

OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]