{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/webrtc-pc/issues/310","labels_url":"https://api.github.com/repos/w3c/webrtc-pc/issues/310/labels{/name}","comments_url":"https://api.github.com/repos/w3c/webrtc-pc/issues/310/comments","events_url":"https://api.github.com/repos/w3c/webrtc-pc/issues/310/events","html_url":"https://github.com/w3c/webrtc-pc/issues/310","id":107662849,"number":310,"title":"WebRTC/WebCrypto mismatch: must-be-supported AlgorithmIdentifier value is rejected by WebCrypto normalization process","user":{"login":"henbos","id":11347890,"avatar_url":"https://avatars.githubusercontent.com/u/11347890?v=3","gravatar_id":"","url":"https://api.github.com/users/henbos","html_url":"https://github.com/henbos","followers_url":"https://api.github.com/users/henbos/followers","following_url":"https://api.github.com/users/henbos/following{/other_user}","gists_url":"https://api.github.com/users/henbos/gists{/gist_id}","starred_url":"https://api.github.com/users/henbos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henbos/subscriptions","organizations_url":"https://api.github.com/users/henbos/orgs","repos_url":"https://api.github.com/users/henbos/repos","events_url":"https://api.github.com/users/henbos/events{/privacy}","received_events_url":"https://api.github.com/users/henbos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-22T07:55:55Z","updated_at":"2015-09-22T15:13:57Z","closed_at":null,"body":"The WebRTC spec states that keygenAlgorithm of generateCertificate uses the WebCrypto AlgorithmIdentifier type and that it must produce a non-error result when normalized according to the WebCrypto algorithm normalization process. It also states that the following value must be supported by the user agent:\r\n{ name: \"RSASSA-PKCS1-v1_5\", modulusLength: 2048, publicExponent: 65537 }\r\nhttp://w3c.github.io/webrtc-pc/archives/20150611/webrtc.html#widl-RTCPeerConnection-generateCertificate-Promise-RTCCertificate--AlgorithmIdentifier-keygenAlgorithm\r\n\r\nThe WebCrypto API on the other hand defines publicExponent as a BigInteger a.k.a. Uint8Array. Parsing the must-be-supported value produces an error result.\r\nhttps://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#RsaKeyGenParams-dictionary\r\n\r\nThis chromium issue shows the code and error message I got when I tried to normalize:\r\nhttps://code.google.com/p/chromium/issues/detail?id=534416"},"comment":{"url":"https://api.github.com/repos/w3c/webrtc-pc/issues/comments/142320066","html_url":"https://github.com/w3c/webrtc-pc/issues/310#issuecomment-142320066","issue_url":"https://api.github.com/repos/w3c/webrtc-pc/issues/310","id":142320066,"user":{"login":"martinthomson","id":67641,"avatar_url":"https://avatars.githubusercontent.com/u/67641?v=3","gravatar_id":"","url":"https://api.github.com/users/martinthomson","html_url":"https://github.com/martinthomson","followers_url":"https://api.github.com/users/martinthomson/followers","following_url":"https://api.github.com/users/martinthomson/following{/other_user}","gists_url":"https://api.github.com/users/martinthomson/gists{/gist_id}","starred_url":"https://api.github.com/users/martinthomson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinthomson/subscriptions","organizations_url":"https://api.github.com/users/martinthomson/orgs","repos_url":"https://api.github.com/users/martinthomson/repos","events_url":"https://api.github.com/users/martinthomson/events{/privacy}","received_events_url":"https://api.github.com/users/martinthomson/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T15:13:57Z","updated_at":"2015-09-22T15:13:57Z","body":"That is just a mistake in the spec.  The actual implementation uses the\nugly form required by WebCrypto.\n\nE.g.,\nhttps://dxr.mozilla.org/mozilla-central/source/dom/media/tests/mochitest/test_peerConnection_certificates.html?offset=400#137\n\nAs for the marvelous choice of form in WebCrypto, I would have been much\nhappier with a union (BufferSource or unsigned long), but usability didn't\nseem to be a high priority for the designers of that API.\nOn Sep 22, 2015 1:02 AM, \"henbos\" <notifications@github.com> wrote:\n\n> (Does it make sense for publicExponent to be a BigInteger/Uint8Array when\n> this value can be represented by 3 bytes and JavaScript numbers can support\n> much much larger integer ranges than that? Would you ever want\n> publicExponent's value to exceed the js Number's safe integer range?)\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/w3c/webrtc-pc/issues/310#issuecomment-142207201>.\n>\n"}}