WebKit on Mac built with CommonCrypto does not support Elliptic Curve P-521 in WebCrypto for ECDSA and ECDH. The code [2] only allows P-256 or P-384. Lack of support for P-521 is noted in the "Update on Web Cryptography" blog post [1], but the bug 169231 was resolved without addressing support for P-521 on Mac with according to [Bug 169231 Comment 4][3] because of missing support in CommonCrypto. Leaving out P-521 support might be reasonable, I'm not an expert on the strength of these primitives. But I imagine that supporting it would be nice for compatibility with Firefox and Chrome, both of which support P-521. Feel free to reopen bug 169231, and close this as a duplicate :) (sorry, for the noise, but this seems like a compatibility issue worth tracking) [1]: https://webkit.org/blog/7790/update-on-web-cryptography/ [2]: https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/crypto/mac/CryptoKeyECMac.cpp?rev=239692#L105 [3]: https://bugs.webkit.org/show_bug.cgi?id=169231#c4
<rdar://problem/69667220>
Created attachment 432998 [details] WIP Patch
Created attachment 432999 [details] WIP Patch
A couple of tests are crashing in signECDSA(), I will need to figure out why.
Created attachment 433036 [details] WIP Patch
Created attachment 433037 [details] Patch
Created attachment 433043 [details] Patch
Created attachment 433065 [details] Patch
Comment on attachment 433065 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433065&action=review > Source/WebCore/crypto/mac/CryptoKeyECMac.cpp:62 > + return size == 133; It would be nice if these were given names instead of just magic numbers. Or they could be calculated from constexpr expressions. > Source/WebCore/crypto/mac/CryptoKeyECMac.cpp:78 > + return size == 66; ditto.
Created attachment 433090 [details] Patch
(In reply to Alex Christensen from comment #9) > Comment on attachment 433065 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=433065&action=review > > > Source/WebCore/crypto/mac/CryptoKeyECMac.cpp:62 > > + return size == 133; > > It would be nice if these were given names instead of just magic numbers. > Or they could be calculated from constexpr expressions. > > > Source/WebCore/crypto/mac/CryptoKeyECMac.cpp:78 > > + return size == 66; > > ditto. Fixed. Now computed using constexpr functions instead of hardcoded values.
Committed r279688 (239493@main): <https://commits.webkit.org/239493@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 433090 [details].