ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] epan_base64_decode(): failure when string contains a NUL charact

From: Uli Heilmeier <zeugs@xxxxxxxxxxxx>
Date: Wed, 17 Apr 2013 22:27:42 +0200
Hello list,

I'm currently trying to improve the SMTP dissector regarding the AUTH command.
Up to now I finished the 'AUTH LOGIN' mechanism (s. Bug 8591). Next I
would like to decode the 'AUTH PLAIN' mechanism (RFC 4616).

With the PLAIN mechanism the packet has a base64 encoded string containing:
[authorization user](\x00)[authentication user](\x00)[password]

For example:
dGVzdAB0ZXN0ADEyMzQ= contains test(NUL)test(NUL)1234

I tried to decode the base64 string with the epan_base64_decode() function
(from epan/base64.h). Unfortunately this fails. I only get a wrong three
bytes long string.
I guess the problem is the NUL character as a delimiter.

Do you have an idea if this is bug in the epan_base64_decode() function or
do I have to do the decoding another way?


Thanks a lot!
Sincerely
Uli