<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>262613</bug_id>
          
          <creation_ts>2023-10-04 06:00:28 -0700</creation_ts>
          <short_desc>Ed25519 JWK import should ignore the &quot;alg&quot; JWK member</short_desc>
          <delta_ts>2025-04-01 06:05:23 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>Safari 17</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          <see_also>https://bugs.chromium.org/p/chromium/issues/detail?id=1489245</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, WPTImpact</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Filip Skokan">panva.ip</reporter>
          <assigned_to name="Javier Fernandez">jfernandez</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>jfernandez</cc>
    
    <cc>me</cc>
    
    <cc>nitinmahendru</cc>
    
    <cc>panva.ip</cc>
    
    <cc>pascoe</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wilander</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1982413</commentid>
    <comment_count>0</comment_count>
    <who name="Filip Skokan">panva.ip</who>
    <bug_when>2023-10-04 06:00:28 -0700</bug_when>
    <thetext>As per https://github.com/WICG/webcrypto-secure-curves/pull/24 the &quot;alg&quot; JWK member is now ignored during JWK import, and missing during JWK export for Ed25519 keys.

Safari correctly handles the latter but not the former, the &quot;alg&quot; JWK member is not ignored during import.

```
const jwk = {
  crv: &quot;Ed25519&quot;,
  x: &quot;2OGJY9gJ1IfZVJrMrsZ0Ln7rok2KDTsUt-PK6gaJPcw&quot;,
  kty: &quot;OKP&quot;,
  alg: &quot;this should now be ignored&quot;,
};

crypto.subtle.importKey(&quot;jwk&quot;, jwk, &quot;Ed25519&quot;, true, [&quot;verify&quot;]).then((key) =&gt; {
  crypto.subtle.exportKey(&quot;jwk&quot;, key).then((exportedJwk) =&gt; {
    if (exportedJwk.alg) {
      console.log(&quot;❌ alg should be missing&quot;);
    }
  });
});
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1982414</commentid>
    <comment_count>1</comment_count>
    <who name="Filip Skokan">panva.ip</who>
    <bug_when>2023-10-04 06:01:20 -0700</bug_when>
    <thetext>WPT update for the draft spec change https://github.com/web-platform-tests/wpt/pull/42333</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1984275</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-10-11 06:01:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/116806236&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1994970</commentid>
    <comment_count>3</comment_count>
    <who name="Javier Fernandez">jfernandez</who>
    <bug_when>2023-11-27 08:48:50 -0800</bug_when>
    <thetext>I&apos;m working on a patch for this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1995341</commentid>
    <comment_count>4</comment_count>
    <who name="Javier Fernandez">jfernandez</who>
    <bug_when>2023-11-28 10:36:41 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/21006</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2014417</commentid>
    <comment_count>5</comment_count>
    <who name="Javier Fernandez">jfernandez</who>
    <bug_when>2024-02-16 02:23:33 -0800</bug_when>
    <thetext>It seems Chrome reviewers have doubts regarding the decision to remove the &apos;alg&apos; field from the JWK import operation&apos;s logic. 

I&apos;d rather wait until there is more consensus before merging the patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2070060</commentid>
    <comment_count>6</comment_count>
    <who name="Javier Fernandez">jfernandez</who>
    <bug_when>2024-10-23 05:43:47 -0700</bug_when>
    <thetext>It seems that FF implementation ignores the &quot;alg&quot; JWK member, as it passes the related tests [1]. It&apos;d be useful to know WebKit&apos;s position on this regard, given than apparently Chrome&apos;s concerns are debatable, from what I could extract from the conversation in the mentioned Chrome bug. 

[1] https://wpt.fyi/results/WebCryptoAPI/import_export/okp_importKey_Ed25519.https.any.html?label=experimental&amp;label=master&amp;aligned</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2101379</commentid>
    <comment_count>7</comment_count>
    <who name="Javier Fernandez">jfernandez</who>
    <bug_when>2025-03-07 08:23:02 -0800</bug_when>
    <thetext>It seems the spec introduced again the &quot;alg&quot; key in the JWK format, see https://github.com/w3c/webcrypto/pull/401

I guess we can close this bug as invalid and perhaps file a new one if the current behavior doesn&apos;t match the new possible values of the &quot;alg&quot; member.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>