<?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>247471</bug_id>
          
          <creation_ts>2022-11-03 18:19:02 -0700</creation_ts>
          <short_desc>Audit use of cryptographically random functions</short_desc>
          <delta_ts>2022-11-10 17:19:17 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Platform</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=247581</see_also>
          <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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Don Olmstead">don.olmstead</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>darin</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1910254</commentid>
    <comment_count>0</comment_count>
    <who name="Don Olmstead">don.olmstead</who>
    <bug_when>2022-11-03 18:19:02 -0700</bug_when>
    <thetext>Cryptographically random numbers are expensive to generate and can have a negative performance impact. Determine if code using them should actually be using them instead of a weak random number.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910844</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2022-11-07 12:34:49 -0800</bug_when>
    <thetext>I just noticed that we have two identical functions in two different headers:

cryptographicallyRandomNumber
cryptographicallyRandomUint32</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1910850</commentid>
    <comment_count>2</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2022-11-07 12:47:42 -0800</bug_when>
    <thetext>Not necessarily part of this bug, but I suggest we do these 9 things:

1) Change the 3 callers of cryptographicallyRandomUint32 to use cryptographicallyRandomNumber instead.
2) Remove cryptographicallyRandomUint32.
3) Move cryptographicallyRandomUint64 to CryptographicallyRandomNumber.h
4) Move cryptographicallyRandomUnitInterval to CryptographicallyRandomNumber.h.
5) Rename cryptographicallyRandomUint64 to cryptographicallyRandomUInt64 or cryptographicallyRandom&lt;uint64_t&gt;.
6) Consider renaming cryptographicallyRandomNumber to cryptographicallyRandomUInt32 or cryptographicallyRandom&lt;uint32_t&gt;.
7) Consider renaming weakRandom to weakRandomUInt32 or weakRandom&lt;uint32_t&gt;.
8) Consider renaming RandomNumber.h to WeakRandomNumber.h.
9) Document that cryptographicallyRandomUnitInterval has only 32 bits of randomness in it to further discourage uninformed use of it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1911712</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-11-10 17:19:17 -0800</bug_when>
    <thetext>&lt;rdar://problem/102219729&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>