Re: [openssl-users] base64 decode in C

2015-03-19 Thread Prashant Bapat
d. >> >> >> >> >> >> *From:* openssl-users [mailto:openssl-users-boun...@openssl.org] *On >> Behalf Of *Prashant Bapat >> *Sent:* Wednesday, March 18, 2015 8:08 AM >> *To:* openssl-users >> *Subject:* Re: [openssl-users] base64 decode in C >

Re: [openssl-users] base64 decode in C

2015-03-19 Thread Prashant Bapat
> *From:* openssl-users [mailto:openssl-users-boun...@openssl.org] *On > Behalf Of *Prashant Bapat > *Sent:* Wednesday, March 18, 2015 8:08 AM > *To:* openssl-users > *Subject:* Re: [openssl-users] base64 decode in C > > > > Hi Dave and Walter, > > > > Thanks

Re: [openssl-users] base64 decode in C

2015-03-18 Thread Scott Neugroschl
Sent: Wednesday, March 18, 2015 8:08 AM To: openssl-users Subject: Re: [openssl-users] 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.

Re: [openssl-users] base64 decode in C

2015-03-18 Thread Walter H.
On 18.03.2015 16:08, Prashant Bapat wrote: printf("Base64 decoded string is : %s\n", b64_decode(str, strlen(str))); // This should print binary for a ssh key. not really, because the return of b64_decode is not a C string; and the format specfier %s expects a C string; smime.p7s Description

Re: [openssl-users] base64 decode in C

2015-03-18 Thread Jakob Bohm
Please refer to Dave Thompson's answer, it describes your problem. On 18/03/2015 16:08, Prashant Bapat wrote: 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

Re: [openssl-users] base64 decode in C

2015-03-18 Thread Ken Goldman
As someone already posted, you can't use strlen on an array that is not a string. On 3/18/2015 11:08 AM, Prashant Bapat wrote: 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. Bu

Re: [openssl-users] base64 decode in C

2015-03-18 Thread Prashant Bapat
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 printin

Re: [openssl-users] base64 decode in C

2015-03-18 Thread Walter H.
Hi, before calling this function, remove any whitespace; Walter smime.p7s Description: S/MIME Cryptographic Signature ___ openssl-users mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users

Re: [openssl-users] base64 decode in C

2015-03-18 Thread Dave Thompson
> From: openssl-users On Behalf Of Prashant Bapat > Sent: Wednesday, March 18, 2015 03:37 > I'm trying to use the base64 decode function in C. > This works well for simple b64 encoded strings like "hello world!" etc. > But when I want to b64 decode the contents of a SSH public key, it fails. >

[openssl-users] base64 decode in C

2015-03-18 Thread Prashant Bapat
Hi, Most likely this has been answered before, please bear with me. I'm trying to use the base64 decode function in C. Below is the function. char *b64_decode(unsigned char *input, int length) { BIO *b64, *bmem; char *buffer = (char *)malloc(length); memset(buffer, 0, length); b6