Julien ALLANOS wrote:
...
Actually, I have tested the following:
EVP_CIPHER_CTX_init(&ctx);
EVP_CipherInit_ex(&ctx, EVP_aes_192_ecb(), NULL, key->data, NULL, 1);
if (!EVP_CipherUpdate(&ctx, ciphertext->data, (int *)
&ciphertext->length,
plaintext->data, (int) plaintext->length))
{
EVP_CIPHER_CTX_cleanup(&ctx);
return NULL;
}
if (!EVP_CipherFinal_ex(&ctx, ciphertext->data,
(int *) &ciphertext->length))
here you overwrite the previously set length and data. Have a look
at the do_crypt example in the EVP_EncryptInit manpage.
Nils
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager [EMAIL PROTECTED]