<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#c17">Comment # 17</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:ajohnson@redneon.com" title="Adrian Johnson <ajohnson@redneon.com>"> <span class="fn">Adrian Johnson</span></a>
</span></b>
        <pre>(In reply to Hans-Ulrich Jüttner from <a href="show_bug.cgi?id=99271#c16">comment #16</a>)
<span class="quote">> 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]
> 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'.</span >

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.

It would also be useful to make pdfsig to print the ranges and
signsTotalDocument info.</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>