We have several functions using if/then/else clauses and ternary operators to reuse the logic structure between several algorithms that use the OKP keys (eg, Curve25519 and Curve488). While it's not a big deal for Curve25519, since we are talking just about 2 algorithms, it may become a problem if we want to add support for Curve488 in the future.
Pull request: https://github.com/WebKit/WebKit/pull/17768
Committed 268079@main (1fa83f2bc4ee): <https://commits.webkit.org/268079@main> Reviewed commits have been landed. Closing PR #17768 and removing active labels.
<rdar://problem/115649943>
Debian Stable and Ubuntu 20.04 build bots are failing after this patch with the following error: https://build.webkit.org/#/builders/595/builds/13369 ``` In file included from /home/buildbot/worker/GTK-Linux-64-bit-Release-Ubuntu-2004-Build/build/WebKitBuild/Release/WebCore/DerivedSources/unified-sources/UnifiedSource-44a97133-6.cpp:4: /home/buildbot/worker/GTK-Linux-64-bit-Release-Ubuntu-2004-Build/build/Source/WebCore/crypto/gcrypt/CryptoKeyOKPGCrypt.cpp: In function ‘const std::array<unsigned char, 12> WebCore::algorithmId(WebCore::CryptoKeyOKP::NamedCurve)’: /home/buildbot/worker/GTK-Linux-64-bit-Release-Ubuntu-2004-Build/build/Source/WebCore/crypto/gcrypt/CryptoKeyOKPGCrypt.cpp:260:25: error: could not convert ‘{{""}}’ from ‘<brace-enclosed initializer list>’ to ‘const std::array<unsigned char, 12>’ 260 | return { { "" } }; | ^ | | | <brace-enclosed initializer list> ninja: build stopped: subcommand failed. ```
Re-opening for pull request https://github.com/webkit/webkit/pull/17917
Committed 268126@main (0d052d134bf0): <https://commits.webkit.org/268126@main> Reviewed commits have been landed. Closing PR #17917 and removing active labels.