Bug 261550 - [WebCrypto] Refactoring: Add checks for supported algorithms
Summary: [WebCrypto] Refactoring: Add checks for supported algorithms
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Diego Pino
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-14 00:54 PDT by Javier Fernandez
Modified: 2023-09-19 08:29 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Javier Fernandez 2023-09-14 00:54:30 PDT
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.
Comment 1 Javier Fernandez 2023-09-14 01:12:08 PDT
Pull request: https://github.com/WebKit/WebKit/pull/17768
Comment 2 EWS 2023-09-18 03:29:48 PDT
Committed 268079@main (1fa83f2bc4ee): <https://commits.webkit.org/268079@main>

Reviewed commits have been landed. Closing PR #17768 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-09-18 03:30:16 PDT
<rdar://problem/115649943>
Comment 4 Diego Pino 2023-09-19 08:20:42 PDT
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.
```
Comment 5 Diego Pino 2023-09-19 08:21:22 PDT
Re-opening for pull request https://github.com/webkit/webkit/pull/17917
Comment 6 EWS 2023-09-19 08:29:30 PDT
Committed 268126@main (0d052d134bf0): <https://commits.webkit.org/268126@main>

Reviewed commits have been landed. Closing PR #17917 and removing active labels.