base64 decode in C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I believe the SSH pubkey is binary data, not ASCII, so strlen() will not work on it if it has embedded NUL chars.
As Dave Thompson suggested, instead of strlen(), use the length returned from BIO_read.


From: openssl-users [mailto:openssl-users-bounces@xxxxxxxxxxx] On Behalf Of Prashant Bapat
Sent: Wednesday, March 18, 2015 8:08 AM
To: openssl-users
Subject: Re: base64 decode in C

Hi Dave and Walter,

Thanks for our reply.

I'm not doing anything different for the ssh pubkey. I'm able to decode it using the "openssl enc -base64 -d -A" command. But not using the C program.

Attaching my entire code here. After getting the base64 decoded I'm calculating the MD5 sum and printing it. This works for a regular string but not for SSH pubkey.

Thanks again.

--Prashant

On 18 March 2015 at 18:04, Walter H. <Walter.H at mathemainzel.info<mailto:Walter.H at mathemainzel.info>> wrote:
Hi,

before calling this function,
remove any whitespace;

Walter



_______________________________________________
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20150318/a6cff623/attachment-0001.html>


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux