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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>27591</bug_id>
          
          <creation_ts>2014-12-12 02:56:46 +0000</creation_ts>
          <short_desc>Must the reflected &quot;publicExponent&quot; for generated RSA keys exactly match input?</short_desc>
          <delta_ts>2016-05-24 00:04:34 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Web Cryptography</product>
          <component>Web Cryptography API Document</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eric Roman">ericroman</reporter>
          <assigned_to name="Ryan Sleevi">sleevi</assigned_to>
          <cc>ietf</cc>
    
    <cc>public-webcrypto</cc>
    
    <cc>watsonm</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>116193</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Roman">ericroman</who>
    <bug_when>2014-12-12 02:56:46 +0000</bug_when>
    <thetext>The Generate key operation for RSASSA-PKCS1-v1_5 says:

7. Set the publicExponent attribute of algorithm to equal the publicExponent attribute of normalizedAlgorithm.

I am unsure if this implies that publicExponent is a normalized BigInteger or not.

The section on BigIntegers says that &quot;Values read from the API SHALL have minimal typed array length&quot;

Does this assignment count as such a &quot;read&quot;?

Example:

If generateKey() is called with publicExponent = 00000000000000010001, an implementation should be able to reflect key.algorithm.publicExponent as 010001 and not preserve the zeros.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116195</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Roman">ericroman</who>
    <bug_when>2014-12-12 03:01:16 +0000</bug_when>
    <thetext>By comparison, the importKey operation is a bit clearer on this as it says:

&quot;Set the publicExponent attribute of algorithm to the BigInteger representation of the RSA public exponent.&quot;

(Keys imported from format=&quot;jwk&quot; can&apos;t have leading zeros in the public exponent, however those from format=&quot;pkcs8&quot; or &quot;spki&quot; could I believe)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125355</commentid>
    <comment_count>2</comment_count>
    <who name="jimsch">ietf</who>
    <bug_when>2016-03-04 03:29:31 +0000</bug_when>
    <thetext>I have do not know what is meant by the phrase &quot;read from the API&quot;.  If I was going to guess, I would say that it applies to any value returned to the user from the API.  Thus in step 7 there would be an implied normalization of the BigInteger value to remove any leading zero bytes.

Yes you are correct that the exponent could in theory have a leading zero value if this is needed to make sure that it does not look like a negative number as ASN.1 only encodes signed numbers.  I would assume that this leading byte would be stripped in this case as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126521</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Watson">watsonm</who>
    <bug_when>2016-05-24 00:04:34 +0000</bug_when>
    <thetext>Moved to https://github.com/w3c/webcrypto/issues/61</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>