You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by Dittmann Werner <we...@siemens.com> on 2004/05/25 08:40:37 UTC
AW: DO NOT REPLY [Bug 29188] New: - Minor clean-ups and speed/m
emory improvment
All,
just a short note about Base64. I use the Base64 of XML
security in WSS4J functions and it works perfectly. Any
reason why to use the Xerces implementation?
In addition the Base64 of XML security provides a way
to control line wrap, that is if I call
Sting xxx = Base64.encode(data, 0);
the line is not wrapped. Specifing a value > 0 (min. 8 I believe)
defines the maxiumum line length.
One specific functions depends on the "no line wrap" mechanism
(interoperability reasons).
Regards,
Werner
> -----Ursprüngliche Nachricht-----
> Von: bugzilla@apache.org [mailto:bugzilla@apache.org]
> Gesendet: Dienstag, 25. Mai 2004 00:37
> An: security-dev@xml.apache.org
> Betreff: DO NOT REPLY [Bug 29188] New: - Minor clean-ups and
> speed/memory improvment
>
>
> DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
> RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
> <http://issues.apache.org/bugzilla/show_bug.cgi?id=29188>.
> ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
> INSERTED IN THE BUG DATABASE.
>
http://issues.apache.org/bugzilla/show_bug.cgi?id=29188
Minor clean-ups and speed/memory improvment
Summary: Minor clean-ups and speed/memory improvment
Product: Security
Version: cvs
Platform: Other
OS/Version: Other
Status: NEW
Severity: Enhancement
Priority: Other
Component: Signature
AssignedTo: security-dev@xml.apache.org
ReportedBy: raul-info@r-bg.com
A patch that makes the tests runtime goesfrom 46sec to 34sec (at least in my
machine). Tomorrow I'll post a more detailed description of the patch, but it
contains mostly clean-ups, the replace of b64 encoder by the b64 encoder of
xerces, and the share of cachedxpathapi between all the methods that work over
the signature document. Less garbage is produced and the memory footprint has
been lowered a little.
All the tests are running ok. But two test has been patch (it seems that the
xerces b64 adds a \n where the original does not).
Regards
bug in transcodeFromUTF8 function
Posted by Nedelcho Stanev <de...@gmx.co.uk>.
Hello all,
there are one small bug in this function.
and when package of data is more than 2048 bytes exception occurs
problem come from loop where we pass trough original source
line 347
int toEat = ( bytesToEat > 2048 ? 2048 : bytesToEat );
must be replaced
int toEat = ((bytesToEat - totalBytesEaten) > 2048 ? 2048 : bytesToEat - totalBytesEaten);
in this case calcuation of size is ok, and function works perfect
regards,
decho
Re: AW: DO NOT REPLY [Bug 29188] New: - Minor clean-ups and speed/m emory improvment
Posted by ra...@r-bg.com.
On 25/05/2004, at 8:40, Dittmann Werner wrote:
> All,
>
> just a short note about Base64. I use the Base64 of XML
> security in WSS4J functions and it works perfectly. Any
> reason why to use the Xerces implementation?
>
> In addition the Base64 of XML security provides a way
> to control line wrap, that is if I call
> Sting xxx = Base64.encode(data, 0);
> the line is not wrapped. Specifing a value > 0 (min. 8 I believe)
> defines the maxiumum line length.
>
> One specific functions depends on the "no line wrap" mechanism
> (interoperability reasons).
>
> Regards,
> Werner
>
I have test both the xerces & xml-sec native and the xerces is faster
(about 4%, in total runtime i.e. with xerces all the tests run 4%
faster)
and generates less garbage. Also it is nice to reuse code
between projects, isn't it?.
It's true that I haven't check if xml-sec encoder is faster(slimmer)
that
the xerces one. I have replace both, perhaps is good to test xerces
decoder
with xml-sec encoder.
Any way, perhaps is good to send patch to the xerces implementation
to implement this behaviour.
Regards,
Raul
RE: BASE 64
Posted by ra...@r-bg.com.
>> and what about the sun.misc.BASE64Decoder ????
>
> And what if you're not on that JDK? The problem with using any other
> decoder, including Xerces', is that not everybody uses those components.
> Until Sun standardizes a BASE64 API in the JDK, there's no good answer.
>
> -- Scott
>
>
What about to include(copy) the base64 code handling from xerces to xml-sec?
This is not a thing that i like doing, but it´s true that there is not
dependece between xerces and xml-sec(I don't know if there is anyone that
has tested it with outher dom parsers).
I think that the license is the same, and we can copy and modified, to
mimic the old beahviour.
Anyway my patch don't remove the old code, it only forwards the
decode(string) and encode(byte) to the same function in xerces. The old
ones with the integer are still working. The speed-up and memory
consumptions reductions are really mesourable.
Regards,
Raul
Raul
RE: BASE 64
Posted by Scott Cantor <ca...@osu.edu>.
> and what about the sun.misc.BASE64Decoder ????
And what if you're not on that JDK? The problem with using any other
decoder, including Xerces', is that not everybody uses those components.
Until Sun standardizes a BASE64 API in the JDK, there's no good answer.
-- Scott
BASE 64
Posted by Martin Labarthe Dubois <du...@consist.com.ar>.
and what about the sun.misc.BASE64Decoder ????
public static byte[] BASE64toByteArray(String pBASE64string) throws
Exception {
return new BASE64Decoder().decodeBuffer(pBASE64string);
}
public static String ByteArrayToBASE64(byte[] pByteArray) throws Exception
{
return new BASE64Encoder().encode(pByteArray);
}
----- Original Message -----
From: "Erwin van der Koogh" <vd...@apache.org>
To: <se...@xml.apache.org>
Sent: Tuesday, May 25, 2004 3:55 AM
Subject: Re: AW: DO NOT REPLY [Bug 29188] New: - Minor clean-ups and speed/m
emory improvment
> > just a short note about Base64. I use the Base64 of XML
> > security in WSS4J functions and it works perfectly. Any
> > reason why to use the Xerces implementation?
>
> The Base64 encoding class in XML Security is quite a mess and I have been
> trying to replace it as well, with something standard, faster and
cleaner..
>
> > In addition the Base64 of XML security provides a way
> > to control line wrap, that is if I call
> > Sting xxx = Base64.encode(data, 0);
> > the line is not wrapped. Specifing a value > 0 (min. 8 I believe)
> > defines the maxiumum line length.
> >
> > One specific functions depends on the "no line wrap" mechanism
> > (interoperability reasons).
>
> .. but I don't think this is the time to do that. The right time to do
this
> is with the next version of the toolkit, when everything should be behind
a
> JSR105 layer and it will be obvious when people will be relying on our
> private code and when they are relying on the public interface.
>
> Any other thoughts?
>
> Erwin
>
Re: AW: DO NOT REPLY [Bug 29188] New: - Minor clean-ups and
speed/m emory improvment
Posted by Erwin van der Koogh <vd...@apache.org>.
> just a short note about Base64. I use the Base64 of XML
> security in WSS4J functions and it works perfectly. Any
> reason why to use the Xerces implementation?
The Base64 encoding class in XML Security is quite a mess and I have been
trying to replace it as well, with something standard, faster and cleaner..
> In addition the Base64 of XML security provides a way
> to control line wrap, that is if I call
> Sting xxx = Base64.encode(data, 0);
> the line is not wrapped. Specifing a value > 0 (min. 8 I believe)
> defines the maxiumum line length.
>
> One specific functions depends on the "no line wrap" mechanism
> (interoperability reasons).
.. but I don't think this is the time to do that. The right time to do this
is with the next version of the toolkit, when everything should be behind a
JSR105 layer and it will be obvious when people will be relying on our
private code and when they are relying on the public interface.
Any other thoughts?
Erwin