From 4804db38a576a9a474e28075a9a08ffd9e8d8246 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Wed, 15 Nov 2023 08:43:07 -0500 Subject: [PATCH] Fix missing ivlen initializer for 40-bit RC4 (Issue #51) --- CHANGES.md | 1 + pdfio-crypto.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index a6df050..c8c86c2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ v1.1.3 (Month DD, YYYY) ----------------------- - Fixed Unicode font support (Issue #16) +- Fixed missing initializer for 40-bit RC4 encryption (Issue #51) v1.1.2 (October 10, 2023) diff --git a/pdfio-crypto.c b/pdfio-crypto.c index 8aa930d..6d02f58 100644 --- a/pdfio-crypto.c +++ b/pdfio-crypto.c @@ -1,7 +1,7 @@ // // Cryptographic support functions for PDFio. // -// Copyright © 2021 by Michael R Sweet. +// Copyright © 2021-2023 by Michael R Sweet. // // Licensed under Apache License v2.0. See the file "LICENSE" for more // information. @@ -446,6 +446,7 @@ _pdfio_crypto_cb_t // O - Decryption callback or `NULL` for none // Initialize the RC4 context using 40 bits of the digest... _pdfioCryptoRC4Init(&ctx->rc4, digest, 5); + *ivlen = 0; return ((_pdfio_crypto_cb_t)_pdfioCryptoRC4Crypt); case PDFIO_ENCRYPTION_RC4_128 :