Re: weird bug

2013-08-16 Thread Ztatik Light
strange i think it has something to do with me using rb and wb instead of r and w... On Fri, Aug 16, 2013 at 2:14 AM, Ztatik Light ztatik.li...@gmail.comwrote: So, I'm having a really weird issue... i'm trying simple file encryption/decryption with BIO_*, but if the encrypted file is in a

Re: weird bug

2013-08-16 Thread Ztatik Light
maybe not - still confused On Fri, Aug 16, 2013 at 2:21 AM, Ztatik Light ztatik.li...@gmail.comwrote: strange i think it has something to do with me using rb and wb instead of r and w... On Fri, Aug 16, 2013 at 2:14 AM, Ztatik Light ztatik.li...@gmail.comwrote: So, I'm having a really

Re: weird bug

2013-08-16 Thread Ztatik Light
ps, yes, line 29 is a mistake and should read: char new_filename[strlen( filename ) + 5]; But even with that fix i get the same results On Fri, Aug 16, 2013 at 2:27 AM, Ztatik Light ztatik.li...@gmail.comwrote: maybe not - still confused On Fri, Aug 16, 2013 at 2:21 AM, Ztatik Light

Re: weird bug

2013-08-16 Thread Ben Laurie
Try write_data( file_, data, strlen(data) + 1, mykey); On 16 August 2013 03:34, Ztatik Light ztatik.li...@gmail.com wrote: ps, yes, line 29 is a mistake and should read: char new_filename[strlen( filename ) + 5]; But even with that fix i get the same results On Fri, Aug 16, 2013 at

Re: weird bug

2013-08-16 Thread Ztatik Light
same result - did you actually try it? BIO_read is producing this error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt On Fri, Aug 16, 2013 at 3:28 AM, Ben Laurie b...@links.org wrote: Try write_data( file_, data, strlen(data) + 1, mykey); On 16 August 2013

Re: weird bug

2013-08-16 Thread Ztatik Light
If I simply replace EVP_des_ede3_cbc with EVP_des_cbc ... then it works okay Some serious bug? On Fri, Aug 16, 2013 at 10:17 AM, Ztatik Light ztatik.li...@gmail.comwrote: same result - did you actually try it? BIO_read is producing this error: error:06065064:digital envelope

RE: weird bug

2013-08-16 Thread Salz, Rich
Ø Some serious bug? Yes, but in your code: Ø char new_filename[strlen( filename + 5 )]; char new_filename[strlen( filename) + 5]; -- Principal Security Engineer Akamai Technology Cambridge, MA

Re: weird bug

2013-08-16 Thread Ztatik Light
yes, i fixed that.. it's not causing the problem.. Seriously - if i just use des instead of des_ede3 in works. that simple. has got to be a bug On Fri, Aug 16, 2013 at 10:49 AM, Salz, Rich rs...@akamai.com wrote: **Ø **Some serious bug? ** ** Yes, but in your code: **Ø **char

RE: weird bug

2013-08-16 Thread Salz, Rich
Ø Seriously - if i just use des instead of des_ede3 in works. that simple. has got to be a bug Run your code through something like valgrind -- Principal Security Engineer Akamai Technology Cambridge, MA

RE: weird bug

2013-08-16 Thread Salz, Rich
Ø I have no idea wtf is up with all these bugs but i'm surprised openssl is this glitchy It is not. The problem is almost definitely in your code. It is also hard to help when the code you post isn't the code you're trying to debug. Get and run valgrind and see what it says. Compile with

Re: weird bug

2013-08-16 Thread Ken Goldman
On 8/16/2013 1:51 PM, Ztatik Light wrote: found yet another weird peculiarity... In my full application, i need the following lines after both encrypt_file() and decrypt_read(), otherwise i get garbage data: char err[1024]; ERR_error_string( ERR_get_error(), err ); printf( %s\n, err ); And