[PATCH]: Support for brainpool curves from CurveDB in SunEC

Tobias Wagner tobias.wagner at n-design.de
Fri Jan 12 14:12:17 UTC 2018


here is the next patch for brainpool curve support in SunEC.

Differences from the first patch:

* Brainpool curves with less than 256 bits are removed. Subsequently, the curve oid check is made more robust to avoid null
pointer caused Segmentation Faults in memcmp calls.

* Bug JDK-8189594 is fixed.

* Known answer tests for each new curve are added to sun.security.pkcs11.ec.TestECDH. The tests are only executed, if the
tested provider's name is "SunEC" and the tested provider claims to support the respective curve. For SunEC, these tests are
executed during sun.security.ec.TestEC.

I decided to add these test vectors to TestECDH to avoid code duplications, as TestECDH is describes exactly the test
for that kind of test vectors.
The superclass to TestECDH, TestPKCS11, is also adapted to provide a method to check, whether one particular curve is

While the test vectors for the 256, 384 and 512 bit curve are taken from [1], the test vector for brainpoolP320r1 comes from [2].
The latter one is a draft version of RFC 6954.


[1] https://tools.ietf.org/html/rfc7027#appendix-A
[2] https://tools.ietf.org/html/draft-merkle-ikev2-ke-brainpool-00#appendix-A.5

phone: +49 221 222896 17
fax: +49 221 222896 11

n - d e s i g n   G m b H 
Alpenerstr. 16
D-50825 Köln

Amtsgericht Köln HRB 33766 B
Geschäftsführer Andy Kohl 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jdk9_jdk_patch_17287f.diff
Type: application/octet-stream
Size: 23972 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/security-dev/attachments/20180112/09280199/jdk9_jdk_patch_17287f-0001.diff>

More information about the security-dev mailing list