<?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>27448</bug_id>
          
          <creation_ts>2014-11-26 19:24:09 +0000</creation_ts>
          <short_desc>HmacImportParams having a non-required hash is inconsistent with other algorithms</short_desc>
          <delta_ts>2016-05-23 23:40:15 +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>public-webcrypto</cc>
    
    <cc>watsonm</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>115547</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Roman">ericroman</who>
    <bug_when>2014-11-26 19:24:09 +0000</bug_when>
    <thetext>HmacImportParams has an optional &quot;hash&quot; attribute. This is inconsistent with how import works for other algorithms, whereby algorithm parameters need to be fully specified during import.

In particular, HMAC import from JWK allows the &quot;hash&quot; attribute on the import algorithm to be unspecified, and it is filled in using the JWK&apos;s &quot;alg&quot; (if one was specified).

By contrast when importing an RSA key the &quot;hash&quot; attribute is required, even though it could similarly be inferred from the JWK&apos;s &quot;alg&quot;. Another example is the namedCurve attribute when importing EC keys. WebCrypto requires it to be specified even though it could similarly be inferred from the JWK&apos;s &quot;crv&quot; member.

I believe HmacImportParams should make &quot;hash&quot; required to match other algorithms. This also means one less failure case for HMAC&apos;s &quot;get key length&quot; operation (since if length is unspecified then at least the hash is guaranteed to be present).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126497</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Watson">watsonm</who>
    <bug_when>2016-05-23 23:40:15 +0000</bug_when>
    <thetext>Moved to https://github.com/w3c/webcrypto/issues/37</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>