Wireshark-bugs: [Wireshark-bugs] [Bug 2302] Base64 decoder returns incorrect length

Date: Mon, 25 Feb 2008 09:43:17 +0000 (GMT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2302





--- Comment #2 from Peter Kjellerstedt <pkj@xxxxxxxx>  2008-02-25 09:43:12 GMT ---
The base64 encoding is very simple. We know that four encoded bytes will result
in three decoded bytes. The old method incorrectly counted partially decoded
bytes, which hold no real information unless there are more encoded bytes
following (which there isn't at the end).

The following is an example of four base64 encoded strings, and the return
values from the old method and the new one:

       Old    New
A===    1      0 (it is invalid)
AA==    2      1
AAA=    3      2
AAAA    3      3

And the new method is also consistent with the output from 'echo -n "AA==" |
base64 -d | wc -c' for each of the four example strings.


-- 
Configure bugmail: http://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.