<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - make it possible to extract digital signature data (also in pdfsig)"
href="https://bugs.freedesktop.org/show_bug.cgi?id=99271#c18">Comment # 18</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - make it possible to extract digital signature data (also in pdfsig)"
href="https://bugs.freedesktop.org/show_bug.cgi?id=99271">bug 99271</a>
from <span class="vcard"><a class="email" href="mailto:huj@froreich-bioscientia.de" title="Hans-Ulrich Jüttner <huj@froreich-bioscientia.de>"> <span class="fn">Hans-Ulrich Jüttner</span></a>
</span></b>
<pre>(In reply to Adrian Johnson from <a href="show_bug.cgi?id=99271#c17">comment #17</a>)
<span class="quote">> (In reply to Hans-Ulrich Jüttner from <a href="show_bug.cgi?id=99271#c16">comment #16</a>)
> > Created <span class=""><a href="attachment.cgi?id=132053" name="attach_132053" title="Patch fixing this bug and adding support for specification of a validation time">attachment 132053</a> <a href="attachment.cgi?id=132053&action=edit" title="Patch fixing this bug and adding support for specification of a validation time">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=99271&attachment=132053'>[review]</a> [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.
> </span >
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.
<span class="quote">> It would also be useful to make pdfsig to print the ranges and
> signsTotalDocument info.</span >
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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>