Web Crypto: Attempting to sign zero-length data using webcrypto in Microsoft Edge results in an error

Issue #7919579 • Assigned to Steve B.

Details

Author
Greg B.
Created
Jun 17, 2016
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
25.10586
Reports
Reported by 2 people

Sign in to watch or report this issue.

Steps to reproduce

Step 1, generate a keypair e.g.

return webcrypto.subtle.generateKey(alg, true, usages)

where alg is a valid algorithm definition, e.g.

{
name: 'RSASSA-PKCS1-v1_5’,
altName: 'sha256WithRSAEncryption’,
hash: { name: ‘SHA-256’ },
modulusLength: 2048,
publicExponent: new Uint8Array([0x01, 0x00, 0x01]),
usagesPublic: [‘verify’],
usagesPrivate: [‘sign’]
}

Subsequently once the public/private keys have been generated, try to sign empty data array:

return webcrypto.subtle.sign(
alg,
this.private,
new Uint8Array(0)
)

where the alg is the previously used algorithm instance.

In Chrome and Firefox the operation succeeds and returns a 256-bit signature. In Microsoft Edge I get:

Could not complete the operation due to error 8070000b.

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Brad E.”

      Changed Assigned To to “Venkat K.”

      Changed Assigned To from “Venkat K.” to “Steve B.”

    • Also crypto.subtle.encrypt throws an exception with a 0 length byte array, such a dissapointment.

    • Microsoft Edge Team

      Changed Title from “Attempting to sign zero-length data using webcrypto in Microsoft Edge results in an error” to “Web Crypto: Attempting to sign zero-length data using webcrypto in Microsoft Edge results in an error”

    • The issue with crypto.subtle.encrypt throwing an 8070000b error is breaking my tests.

      Now I also have to be super-careful to make sure I never pass an empty input array to any crypto function, knowing it would probably cause the application to crash in Edge.

    You need to sign in to your Microsoft account to add a comment.

    Sign in