Closed isombyt closed 2 years ago
Hi @isombyt!
Nice catch! It indeed looks like the code was wrong there but some tests do not pass with your patch. Would you mind looking into it? I will investigate on my side as well.
I have just added a couple of patch on the dev branch (will merge them into master when they are green) to help with debugging. Your fix seems to break CURVE448 and CURVE25519. This is not so surprising. I am still working on it.
I can also confirm that, without your patch, ECC.generate()
does not use the curve that was configured.
Didn't expected this would break the unit tests. I'm looking into it.
refer to upstream code. https://github.com/Mbed-TLS/mbedtls/blob/d65aeb37349ad1a50e0f6c9b694d4b5290d60e49/library/oid.c#L481 mbedtls have not OID definition for x25519 or x448, which means mbedtls does not have support export x25519 or x448 to DER/PEM. In this case, maybe I should fix the unit test.
update: still need to solve the export format problem. do not merge.
update: still need to solve the export format problem. do not merge.
OK, looks great so far.
should be good to go.
Thank you for your very clear contribution! I'll take care of the formatting errors.
merged in master
The PR fulfills these requirements
More details in CONTRIBUTING.
I am submitting a …
Description
Other information