On 22 Jun 2011, at 5:46 AM, Damir Musulin wrote:
> I have created a decrypt function and it fails (how wonderful)
> 
> The problem lies in the EVP_DecryptFinal_ex.
> I have made use of the ERR_print_errors_fp(stderr); option to see what
> is wrong but it is quite
> a cryptic message:
> 2621:error:0606506D:lib(6):func(101):reason(109):evp_enc.c:323:

I think you will get less-cryptic error messages if you put a  call to 
ERR_load_crypto_strings() near the beginning of your program:

   http://www.openssl.org/docs/crypto/ERR_load_crypto_strings.html

Alternatively, you can look up what reason #109 is in your headers (I think 
it's EVP_R_WRONG_FINAL_BLOCK_LENGTH), or look at line 323 of your version of 
evp.c to see what error condition it's testing there.

As for your actual error, I don't know the cause, but I notice you're giving 
zero bytes of input to the decryption function--- this may make some padding 
modes unhappy:

   http://en.wikipedia.org/wiki/Padding_(cryptography)#CBC_mode


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to