{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/webcrypto/issues/127","repository_url":"https://api.github.com/repos/w3c/webcrypto","labels_url":"https://api.github.com/repos/w3c/webcrypto/issues/127/labels{/name}","comments_url":"https://api.github.com/repos/w3c/webcrypto/issues/127/comments","events_url":"https://api.github.com/repos/w3c/webcrypto/issues/127/events","html_url":"https://github.com/w3c/webcrypto/issues/127","id":165683318,"number":127,"title":"Text for \"get key length\" is missing algorithm normalization","user":{"login":"ericroman920","id":20466597,"avatar_url":"https://avatars.githubusercontent.com/u/20466597?v=3","gravatar_id":"","url":"https://api.github.com/users/ericroman920","html_url":"https://github.com/ericroman920","followers_url":"https://api.github.com/users/ericroman920/followers","following_url":"https://api.github.com/users/ericroman920/following{/other_user}","gists_url":"https://api.github.com/users/ericroman920/gists{/gist_id}","starred_url":"https://api.github.com/users/ericroman920/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericroman920/subscriptions","organizations_url":"https://api.github.com/users/ericroman920/orgs","repos_url":"https://api.github.com/users/ericroman920/repos","events_url":"https://api.github.com/users/ericroman920/events{/privacy}","received_events_url":"https://api.github.com/users/ericroman920/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-14T23:46:55Z","updated_at":"2016-07-18T15:22:52Z","closed_at":null,"body":"In deriveKey()'s step 13:\r\n\r\n> (13) Let length be the result of executing the get key length algorithm specified by normalizedDerivedKeyAlgorithm using derivedKeyType.\r\n\r\nBut then as an example AES-CBC's get key length operation is defined as:\r\n\r\n> If the length member of normalizedDerivedKeyAlgorithm is not 128, 192 or 256, then throw an OperationError.\r\n> \r\n> Return the length member of normalizedDerivedKeyAlgorithm.\r\n> \r\n\r\nThe problem here is that normalizedDerivedKeyAlgorithm is the result of normalizing using \"Import\":\r\n\r\n> Let normalizedDerivedKeyAlgorithm be the result of normalizing an algorithm, with alg set to derivedKeyType and op set to \"importKey\".\r\n\r\nIn the case of AES-CBC the \"Import\" parameters are empty, so normalizedDerivedKeyAlgorithm.length is not defined.\r\n\r\nInstead I believe what should happen is deriveKey() needs an extra step which run the algorithm normalization with op set to \"get key length\", and pass that on to the get key length operation. This will then pass the expected AesDerivedKeyParams (in this particular example).\r\n\r\nAlso once this algorithm normalization is added, step (10) of deriveKey() becomes unnecessary, since NotSupported can implicitly be handled by the normalization step:\r\n\r\n> (10) If the name member of normalizedDerivedKeyAlgorithm does not identify a registered algorithm that supports the get key length operation, then throw a NotSupportedError."},"comment":{"url":"https://api.github.com/repos/w3c/webcrypto/issues/comments/233361640","html_url":"https://github.com/w3c/webcrypto/issues/127#issuecomment-233361640","issue_url":"https://api.github.com/repos/w3c/webcrypto/issues/127","id":233361640,"user":{"login":"mwatson2","id":7593867,"avatar_url":"https://avatars.githubusercontent.com/u/7593867?v=3","gravatar_id":"","url":"https://api.github.com/users/mwatson2","html_url":"https://github.com/mwatson2","followers_url":"https://api.github.com/users/mwatson2/followers","following_url":"https://api.github.com/users/mwatson2/following{/other_user}","gists_url":"https://api.github.com/users/mwatson2/gists{/gist_id}","starred_url":"https://api.github.com/users/mwatson2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwatson2/subscriptions","organizations_url":"https://api.github.com/users/mwatson2/orgs","repos_url":"https://api.github.com/users/mwatson2/repos","events_url":"https://api.github.com/users/mwatson2/events{/privacy}","received_events_url":"https://api.github.com/users/mwatson2/received_events","type":"User","site_admin":false},"created_at":"2016-07-18T15:22:52Z","updated_at":"2016-07-18T15:22:52Z","body":"I agree."}}
{"actor":{"display_login":"mwatson2"}}