+++ This bug was initially created as a clone of Bug #1533666 +++ In https://bugzilla.mozilla.org/show_bug.cgi?id=589158, David Stutzman Created attachment 467756 [details] - "correct patch showing + for lines instead of -" JSS uses SHAxwithEC as their naming for EC Signature algorithms but Sun's "Standard Algorithm Names" are SHAxwithECDSA. I was using Sun's CertPath API to attempt to chain some EC certificates that had SHA384withECDSA signatures and the building of the CertPath threw an exception because it couldn't find a provider that supported SHA384withECDSA. The attached patch just adds the 4 aliases for the standard Sun algorithm names to the JSS provider. Adding these aliases should enable JSS's ECC functionality to be used in more places throughout the entire Java library as it would now support the algorithm names that the library uses. --- Additional comment from Matthew Harmsen on 2018-01-11 17:33:23 EST --- Wan-Teh Chang approved this patch: r=wtc. It would be nice if we could make SHA1withECDSA the algorithm name and make SHA1withEC an alias. Would that break any code? --- Additional comment from Matthew Harmsen on 2018-01-11 17:34:02 EST --- David Stutzman replied: As far as I could tell, the way you guys are creating the provider now, it's reporting the main names of SHAxwithEC. After I added the new aliases I queried the Provider for it's Provider.Services and called getAlgorithm() and it doesn't explicity list the new ones (or any aliases). It seems to only show the initial algorithm name. I don't know if there's a way to get all the aliases for a particular Provider.Service. http://download.oracle.com/javase/6/docs/api/java/security/Provider.Service.html says: "Optionally, it also includes a list of alternate algorithm names for this service (aliases) and attributes, which are a map of (name, value) String pairs," but there doesn't appear to be any getter for that info. http://download.oracle.com/javase/6/docs/technotes/guides/security/crypto/HowToImplAProvider.html#Aliases Not a whole lot of helpful info here, but that's the official word on aliases. On the topic of breaking existing code by changing defaults: Looking at it with this patch applied if you call Signature.getInstance("SHA256withEC"), it will work. If you call Signature.getInstance("SHA256withECDSA"), it will work. If you change the other name to be the default, again either call above will work. The only thing I can see breaking is if someone queries the Provider programatically using Provider.getServices() and then accessing the Provider.Service objects to get names and is expecting to match on the old string (SHAxwithEC) at that point because that won't list aliases. Most likely it wouldn't be a huge deal because I suspect that not many people are using JSS/NSS for ECC at this time, but that's your call.
pushed: https://bugzilla.mozilla.org/show_bug.cgi?id=589158#c6
Hi Christina, Do I need to perform any tests other than ensuring ECC stuff is working for this bug, if yes could you please mention it here?
just make sure it doesn't break ECC should be good enough.
Build used for verification: root@csqa4-guest01 ~ # rpm -qi jss Name : jss Version : 4.4.0 Release : 11.el7 Architecture: x86_64 Install Date: Monday 29 January 2018 10:37:07 PM EST Group : System Environment/Libraries Size : 1029926 License : MPLv1.1 or GPLv2+ or LGPLv2+ Signature : RSA/SHA256, Monday 22 January 2018 07:02:01 PM EST, Key ID 199e2f91fd431d51 Source RPM : jss-4.4.0-11.el7.src.rpm Build Date : Monday 22 January 2018 06:17:27 PM EST Build Host : x86-040.build.eng.bos.redhat.com Relocations : (not relocatable) Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> Vendor : Red Hat, Inc. URL : http://www.mozilla.org/projects/security/pki/jss/ Summary : Java Security Services (JSS) All the certificate system (ECC) operations are working as expected. Hence marking this bug verified.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0958