Update crypto callback to return the number of output bytes (to account for AES

expansion).
This commit is contained in:
Michael R Sweet
2021-10-23 14:37:25 -04:00
parent 19571d00f2
commit 3af39d5d1f
5 changed files with 38 additions and 18 deletions

View File

@@ -69,7 +69,7 @@ _pdfioCryptoRC4Init(
// "inbuffer" and "outbuffer" can point to the same memory.
//
void
size_t // O - Number of output bytes
_pdfioCryptoRC4Crypt(
_pdfio_rc4_t *ctx, // I - Context
uint8_t *outbuffer, // I - Output buffer
@@ -79,6 +79,7 @@ _pdfioCryptoRC4Crypt(
uint8_t tmp, // Swap variable
i, j, // Looping vars
t; // Current S box
size_t outbytes = len; // Number of output bytes
// Loop through the entire buffer...
@@ -107,4 +108,6 @@ _pdfioCryptoRC4Crypt(
// Copy current S box indices back to context...
ctx->i = i;
ctx->j = j;
return (outbytes);
}