<?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>276916</bug_id>
          
          <creation_ts>2024-07-22 16:11:22 -0700</creation_ts>
          <short_desc>[WebCrypto] ECDH and X25519 derive bits should return an empty string when length is zero</short_desc>
          <delta_ts>2024-10-28 14:37:52 -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>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>282002</dependson>
    
    <dependson>282096</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Javier Fernandez">jfernandez</reporter>
          <assigned_to name="Nitin Mahendru">nitinmahendru</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>nitinmahendru</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2047623</commentid>
    <comment_count>0</comment_count>
    <who name="Javier Fernandez">jfernandez</who>
    <bug_when>2024-07-22 16:11:22 -0700</bug_when>
    <thetext>We have reached an important agreement [1] to change the last draft of the WebCrypto API specification to solve a long-term interoperability issue in the deriveBits operation to define the &apos;length&apos; parameter as optional. 

In such conversation it&apos;s been agreed that a zero value for the &apos;length&apos; parameter should return an empty string instead of the whole derived key, as currently WebKit does. It&apos;s worth mentioning that the current draft already specify such behavior for the ECDH and X25519 algorithms, so WebKit&apos;s implementation is not spec-compliant on this regard.

[1] https://github.com/w3c/webcrypto/pull/345</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2047982</commentid>
    <comment_count>1</comment_count>
    <who name="Javier Fernandez">jfernandez</who>
    <bug_when>2024-07-24 03:40:12 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/31146</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2049260</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-07-29 16:12:24 -0700</bug_when>
    <thetext>&lt;rdar://problem/132761687&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2064189</commentid>
    <comment_count>3</comment_count>
    <who name="Javier Fernandez">jfernandez</who>
    <bug_when>2024-09-30 03:53:45 -0700</bug_when>
    <thetext>There is an ongoing discussion [1] to throw an OperatonError exception on any value passed in the &apos;length&apos; parameter that implies truncating the derivedKey material. 

So if that&apos;s approved, this bug should be changed or closed as invalid.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2064190</commentid>
    <comment_count>4</comment_count>
    <who name="Javier Fernandez">jfernandez</who>
    <bug_when>2024-09-30 03:54:26 -0700</bug_when>
    <thetext>(In reply to Javier Fernandez from comment #3)
&gt; There is an ongoing discussion [1] to throw an OperatonError exception on
&gt; any value passed in the &apos;length&apos; parameter that implies truncating the
&gt; derivedKey material. 
&gt; 
&gt; So if that&apos;s approved, this bug should be changed or closed as invalid.

[1] https://github.com/w3c/webcrypto/issues/369</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2069046</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-10-18 01:03:20 -0700</bug_when>
    <thetext>Committed 285383@main (0b46039641c2): &lt;https://commits.webkit.org/285383@main&gt;

Reviewed commits have been landed. Closing PR #31146 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2070187</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2024-10-23 13:45:42 -0700</bug_when>
    <thetext>Re-opened since this is blocked by bug 282002</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2070658</commentid>
    <comment_count>7</comment_count>
    <who name="Nitin Mahendru">nitinmahendru</who>
    <bug_when>2024-10-25 14:30:42 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/35739</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2071060</commentid>
    <comment_count>8</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-10-28 14:37:49 -0700</bug_when>
    <thetext>Committed 285789@main (f9e55bf363c1): &lt;https://commits.webkit.org/285789@main&gt;

Reviewed commits have been landed. Closing PR #35739 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>