serenity icon indicating copy to clipboard operation
serenity copied to clipboard

LibPDF+pdf: Enough stuff to be able to read password-protected PDFs created by macOS

Open nico opened this issue 2 years ago • 1 comments

In particular, implements support for AES in LibPDF.

Also fixes an issue where the linearization detection logic would crash on inputs where the first object is an encrypted compressed stream in a not-linearized file.

nico avatar Jul 11 '23 15:07 nico

@mattco98 for LibPDF.

@alimpfard for the AES client code. I found the API a bit awkward to use: From what I understand, I have to use the span that encrypt() / decrypt() can modify to access the encrypted / decrypted data, which means I can't move the ByteBuffer I have elsewhere but have to make a copy of just the bytes in the span (?)

nico avatar Jul 11 '23 15:07 nico

My tab here had a comment about giving parse_v4_crypt a return type instead of two out params. I've done that, but now that I try to reply to that comment it tells me the comment's been deleted. LMK if you'd prefer me to change it back to the out params. I like the struct return :)

nico avatar Jul 11 '23 19:07 nico

My tab here had a comment about giving parse_v4_crypt a return type instead of two out params. I've done that, but now that I try to reply to that comment it tells me the comment's been deleted. LMK if you'd prefer me to change it back to the out params. I like the struct return :)

Yeah idk what GitHub did there, I started the review and then thought I hit cancel, but I guess I didn't. Anyways, I deleted it because the values coming in had some default values, but it is probably better this way regardless 😄

mattco98 avatar Jul 11 '23 19:07 mattco98