[Poppler-bugs] [Bug 99271] make it possible to extract digital signature data (also in pdfsig)

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jun 19 12:21:17 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=99271

--- Comment #18 from Hans-Ulrich Jüttner <huj at froreich-bioscientia.de> ---
(In reply to Adrian Johnson from comment #17)
> (In reply to Hans-Ulrich Jüttner from comment #16)
> > Created attachment 132053 [details] [review] [review]
> > Patch fixing this bug and adding support for specification of a validation
> > time
> > 
> > I changed the types of 'start' and 'end' to int as they are put into
> > GooString::getChar() which takes an int and would anyway produce an integer
> > overflow for values >= 2GB. I think that should fix the complaint about the
> > differing type of 'len'.
> 
> The start and end needs to be of type Goffset to support PDF files > 2GB.
> 
> +  if (end >= start+6)
> +  {
> +    BaseStream* stream = doc->getBaseStream();
> +    file_size = stream->getLength();
> +    GooString gstr;
> +    stream->fillGooString(&gstr);
> 
> You're reading the entire PDF file into a GooString! Use
> stream->setPos(start) to seek to the start of the signature then read what
> you need into a GooString. Is there an upper limit to the signature size?
> You should set some limit on the amount of data read into a GooString. Or
> use the stream operators (setPos(), getChar(), lookChar() etc) to read
> directly from the stream.
> 

Ok, but then I can't use fillGoString() anymore as it does a reset()
internally. I'll rewrite method getCheckedSignature to use a buffer and
doGetChars() instead.

> It would also be useful to make pdfsig to print the ranges and
> signsTotalDocument info.

signsTotalDocument() is currently only in the qt5 interface which pdfsig
doesn't use. I'll think about adding a similar method to poppler/Form.cc.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20170619/de4b6c57/attachment.html>


More information about the Poppler-bugs mailing list