Quoting Nils Larsch <[EMAIL PROTECTED]>:
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
Fine, it is working well now. Thanks for your help. Can I just assume that:
1/ AES_BLOCK_LENGTH = 16 ?
2/ output buffer size = input buffer size + AES_BLOCK_LENGTH for
EVP_CipherUpdate()?
3/ output buffer size = AES_BLOCK_LENGTH for EVP_CipherFinal_ex()?
--
Julien ALLANOS
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager [EMAIL PROTECTED]