> If I call like this, I get 32-byte return(The first 16 byte string equal to > Ciphertext in the test case) > ret = EVP_EncryptUpdate(&ctx, out, outl, in, inl); > if(!ret) abort(); > len += *outl; > ret = EVP_EncryptFinal_ex(&ctx, out+len, outl); > if(!ret) abort(); > len += *outl;
You added the output twice. You did it the first time, when you did "len += *outl;" but then you did it again when you called EVP_EncryptFinal_ex with '*outl' equal to 16. You need to do one or the other, but not both. You can either take the output as it comes (which is what 'len += *outl;' before EVP_EncryptFinal_ex does) or let it accumulate (which is what calling EVP_EncryptFinal_ex with a nonzero value of *outl does), but you cannot do both. DS ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [email protected] Automated List Manager [EMAIL PROTECTED]
