Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use crypto.subtle instead of closure's sha384 where available #3690

Closed
cramforce opened this issue Jun 21, 2016 · 5 comments
Closed

Use crypto.subtle instead of closure's sha384 where available #3690

cramforce opened this issue Jun 21, 2016 · 5 comments

Comments

@cramforce
Copy link
Member

And late load closure implementation when needed (none of the current major browsers).

The resulting strings must by byte-for-byte compatible.

CC @lannka

@ericlindley-g
Copy link
Contributor

@cramforce — slotting in backlog, but please correct/update as needed

@ericlindley-g ericlindley-g added this to the Backlog milestone Jun 21, 2016
@cramforce cramforce modified the milestones: Next, Backlog Jun 22, 2016
@lannka
Copy link
Contributor

lannka commented Jun 29, 2016

Did some experiments.

  • Latest Chrome, FireFox, Edge, Opera have full support of window.crypto.subtle.digest();
  • Safari supports it with window.crypto.webkitSubtle.digest.
  • IE11 supports it with window.msCrypto.subtle.digest(); however, SHA-1 is not supported; and the return is not a Promise

Basically all browsers AMP supports have usable implementations except Android 4.x system browsers.

@cramforce Do you think it's still necessary to have the fallback of late loading closure implementation?

@cramforce
Copy link
Member Author

What I think we should do is:

  • create a CryptoService or similar
  • use that across this, analytics, CID, etc.
  • have it use builtin by default
  • and late load closure otherwise.

@lannka
Copy link
Contributor

lannka commented Jul 1, 2016

The work is done except the lazy loading part. Can open a separate issue if wanted.

@lannka lannka closed this as completed Jul 1, 2016
@jridgewell
Copy link
Contributor

Can open a separate issue if wanted.

Please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants