- && EVP_EncryptUpdate(cipher->ctx, (unsigned char *)outdata, &len, indata, inlen)
- && EVP_EncryptFinal(cipher->ctx, (unsigned char *)outdata + len, &pad)) {
- if(outlen) *outlen = len + pad;
+ && EVP_EncryptUpdate(cipher->ctx, (unsigned char *)outdata, &len, indata, (int)inlen)
+ && EVP_EncryptFinal_ex(cipher->ctx, (unsigned char *)outdata + len, &pad)) {
+ if(outlen) {
+ *outlen = len + pad;
+ }
+