- int len = *outlen, pad;
- if(EVP_DecryptInit_ex(&cipher->ctx, NULL, NULL, NULL, NULL)
- && EVP_DecryptUpdate(&cipher->ctx, outdata, &len, indata, inlen)
- && EVP_DecryptFinal(&cipher->ctx, outdata + len, &pad)) {
- *outlen = len + pad;
+ int len, pad;
+
+ if(EVP_DecryptInit_ex(cipher->ctx, NULL, NULL, NULL, NULL)
+ && EVP_DecryptUpdate(cipher->ctx, (unsigned char *)outdata, &len, indata, (int)inlen)
+ && EVP_DecryptFinal_ex(cipher->ctx, (unsigned char *)outdata + len, &pad)) {
+ if(outlen) {
+ *outlen = len + pad;
+ }
+