Segmentation fault in openSSL

View: New views
1 Messages — Rating Filter:   Alert me  

Segmentation fault in openSSL

by horacioemilio :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am testing the following simple program which uses openssl to encrypt and decrypt a file:

http://tldp.org/LDP/LG/issue87/misc/vinayak/sym_funcs.c.txt

Once compiled I do:

    ./blowfish input_file.txt output_enc.txt output_dec.txt

I use the options:

   1. G for generating a key
   2. E for encrypting the file, so output_enc.txt is generated
   3. D for decrypting output_enc.txt so output_dec.txt is generated

In the third step I obtain a segmentation fault. A decrypted file is generated but it differs in some characters from the original one. Any ideas?

The segmentation fault seems to come from:

if (EVP_DecryptFinal (&ctx, outbuf + olen, &tlen) != 1)

Process terminating with default action of signal 11 (SIGSEGV) Access not within mapped region at address 0x808080C

Any ideas?

P.D.: I am working in mac os x 10.5.7