Re: [Bug 687317] New: EncryptionR=2 doesn't work withPermissions=-44

"Igor V. Melichev" <[email protected]>
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <[email protected]>
I agree that the check in incorrect.
However the patch is incomplete. It must fix the default value in
gdevpdf.c ln 206 .

Probably GS_8_1X to be patched as well.

Igor.

----- Original Message ----- 
From: "Russell Lang" <[email protected]>
To: <[email protected]>
Sent: Wednesday, February 25, 2004 10:43 AM
Subject: [gs-code-review] [Bug 687317] New: EncryptionR=2 doesn't work
withPermissions=-44


> Log message:
> Fix pdfwrite allowable Permissions for EncryptionR=2.
>
> DETAILS:
> The code was assuming that the extra permissions should be 0's,
> when in fact they should be 1's.  The fixed code is a bit more
> conservative and requires that all reserved bits match the PDF
> specification.
>
> diff -u -r1.89 gdevpdf.c
> --- a/gdevpdf.c 13 Feb 2004 08:08:35 -0000      1.89
> +++ b/gdevpdf.c 25 Feb 2004 03:33:54 -0000
> @@ -545,7 +545,8 @@
>         eprintf("PDF encryption key length must be a multiple of 8.\n");
>         return_error(gs_error_rangecheck);
>      }
> -    if (pdev->EncryptionR == 2 && (pdev->Permissions & (0xF << 8))) {
> +    if (pdev->EncryptionR == 2 &&
> +       ((pdev->Permissions & (0xFFFFFFC3)) != 0xFFFFFFC0)) {
>         eprintf("Some of Permissions are not allowed with R=2.\n");
>         return_error(gs_error_rangecheck);
>      }
> Russell Lang                   [email protected]
> Ghostgum Software Pty Ltd      http://www.ghostgum.com.au/
>
>
> _______________________________________________
> gs-code-review mailing list
> [email protected]
> http://www.ghostscript.com/mailman/listinfo/gs-code-review
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.