[WSS4J] Small bug in WSSecurityEngine?

"Anderson Jonathan" <anderson_jonathan-Tu/[email protected]> Tue, 13 Jan 2004 16:12:50 -0500
Newsgroups gmane.text.xml.wss4j
Message-ID <[email protected]>
Greetings Dims and Werner,

Found a small bug that you might want to track.  WSSecurityEngine, line 145:

String Id = "org.bouncycastle.jce.provider.BouncyCastleProvider";
if (java.security.Security.getProvider(Id) == null) {

The if statement will always return null, as
java.security.Security.getProvider(String name) does not return providers by
classname, rather by java.security.Provider.getName().  BouncyCastle's
provider name is "BC", so even though I've got it configured at the JRE
level, WSSecurityEngine tries to load another instance of it.

However, it looks as if java.security.Security is smart enough to realize it
already has the provider loaded, as the number of loaded providers does not
change after .addProvider is called.

All in all, a minor bug.  I didn't see any bugs logged on your SourceForge
site, so I thought it more effective to just post it here.

Regards,
-Jon




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html