<font size=2 face="sans-serif">I don't blame you. That's perfectly fine
with me. However, how do you think it should be fixed?</font>
<br>
<br><font size=2 face="sans-serif">Vit</font>
<br>
<br><tt><font size=2>Aleksey Sanin <aleksey@aleksey.com> wrote on
05/24/2012 08:11:54 PM:<br>
<br>
> Unfortunately, I have to have the whole document in memory for C14N<br>
> <br>
> Aleksey<br>
> <br>
> On 5/24/12 11:08 AM, Vit Zikmund wrote:<br>
> > Hi Aleksey, thanks for the tip.<br>
> > I've tried it, but apparently, it's not the case. I've debugged
the code<br>
> > and found the source of the error.<br>
> > Here<br>
> > _http://git.gnome.org/browse/xmlsec/tree/src/<br>
> c14n.c#n277_xmlOutputBufferClose(buf)returns<br>
> > negative number, but it's not an error code - it's an overflowed
byte<br>
> > counter.<br>
> > The overflow happens without error during the transformation
execution<br>
> > in the libxml2 code - at the end of *xmlOutputBufferWrite*()
(<br>
> > _http://git.gnome.org/browse/libxml2/tree/xmlIO.c#n3445_).<br>
> > Everything is just an 'int' over there. If I add a line checking
for<br>
> > overflow to keep the value positive, my test passes, but that
is some<br>
> > nasty hack.<br>
> > <br>
> > I've already contacted the author and he said such big value
shouldn't<br>
> > ever be there and suggested this might be a bad design.<br>
> > This is the thread on libxml mailing list:<br>
> > _https://mail.gnome.org/archives/xml/2012-May/msg00075.html_<br>
> > <br>
> > Can you comment on that? Might this be related to your comment
few lines<br>
> > above the error saying:<br>
> > /* we are using a _semi_-hack here: we know that xmlSecPtrList
keeps<br>
> > * all pointers in the big array */<br>
> > <br>
> > Thanks again,<br>
> > Vit<br>
> > <br>
> > Might this be somehow related to the comment few lines above<br>
> > <br>
> > Aleksey Sanin <aleksey@aleksey.com> wrote on 05/23/2012
09:28:11 PM:<br>
> > <br>
> >> The error indicates that we can't allocate output buffer
correctly. If<br>
> >> I would guess, then I would see if the "size" parameter
is treated as<br>
> >> negative number when it exceeds 2G.<br>
> >><br>
> >> Try to change include/xmlsec/xmlsec.h and change the xmlSecSize
to be<br>
> >> a typedef to size_t all the time (dont' forget to recompile
xmlsec<br>
> >> after this change).<br>
> >><br>
> >> Aleksey<br>
> >><br>
> >> On 5/23/12 8:28 AM, Vit Zikmund wrote:<br>
> >> > Hello,<br>
> >> > we are trying to use the XMLSec utility to verify documents
signed with<br>
> >> > our own application and probably have hit a limit of
the document size,<br>
> >> > that XMLSec is able to process.<br>
> >> ><br>
> >> > The simplest question is: Does XMLSec support handling
large<br>
> >> > documents/files? Is is about to? For large I mean 2
gigabytes and more.<br>
> >> ><br>
> >> > I can verify a document of 1GB, but little over 2GB
returns an error:<br>
> >> ><br>
> >> ><br>
> >><br>
> > <br>
> func=xmlSecTransformC14NPushXml:file=c14n.c:line=279:obj=c14n:subj=xmlOutputBufferClose:error=5:libxml2<br>
> >> > library function failed:<br>
> >> ><br>
> >><br>
> > <br>
> func=xmlSecTransformDefaultPushXml:file=transforms.c:line=2417:obj=enveloped-<br>
> >> signature:subj=xmlSecTransformPushXml:error=1:xmlsec<br>
> >> > library function failed:<br>
> >> ><br>
> >><br>
> > <br>
> func=xmlSecTransformCtxXmlExecute:file=transforms.c:line=1236:obj=unknown:subj=xmlSecTransformPushXml:error=1:xmlsec<br>
> >> > library function failed:transform=enveloped-signature<br>
> >> ><br>
> >><br>
> > <br>
> func=xmlSecTransformCtxExecute:file=transforms.c:line=1296:obj=unknown:subj=xmlSecTransformCtxXmlExecute:error=1:xmlsec<br>
> >> > library function failed:<br>
> >> ><br>
> >><br>
> > <br>
> func=xmlSecDSigReferenceCtxProcessNode:file=xmldsig.c:line=1571:obj=unknown:subj=xmlSecTransformCtxExecute:error=1:xmlsec<br>
> >> > library function failed:<br>
> >> ><br>
> >><br>
> > <br>
> func=xmlSecDSigCtxProcessSignedInfoNode:file=xmldsig.c:line=804:obj=unknown:subj=xmlSecDSigReferenceCtxProcessNode:error=1:xmlsec<br>
> >> > library function failed:node=Reference<br>
> >> ><br>
> >><br>
> > <br>
> func=xmlSecDSigCtxProcessSignatureNode:file=xmldsig.c:line=547:obj=unknown:subj=xmlSecDSigCtxProcessSignedInfoNode:error=1:xmlsec<br>
> >> > library function failed:<br>
> >> ><br>
> >><br>
> > <br>
> func=xmlSecDSigCtxVerify:file=xmldsig.c:line=366:obj=unknown:subj=xmlSecDSigCtxSigantureProcessNode:error=1:xmlsec<br>
> >> > library function failed:<br>
> >> > Error: signature failed<br>
> >> > ERROR<br>
> >> ><br>
> >> > If I interpret it right, it seems like it's a problem
of the underlying<br>
> >> > libxm2 library, but the question still stands. I have
built the tool for<br>
> >> > x86_64 from the latest released source and used the
latest libxml2 and<br>
> >> > libxslt sources as well.<br>
> >> ><br>
> >> > Thank you very much in advance.<br>
> >> > Vit Zikmund<br>
> >> ><br>
> <br>
</font></tt>