@aws-crypto/client-browser Buffer usage in raw2der causing ReferenceError when decrypting

Open
#1,050 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
cryptography

Research direction

Start with the browser package's ecdsa_signature.ts and package.json, then trace decrypt() into raw2der to confirm where the global Buffer reference is used. The fix is complete when browser decryption no longer raises ReferenceError, using either the browser-safe helper approach or the declared buffer dependency described in the issue.

Written by the indexing model from the issue text.

Description

Problem:

When using @aws-crypto/client-browser version 3.1.1, calling decrypt() will result in a ReferenceError. decrypt calls raw2der, which includes a reference to global Buffer type. The buffer npm package is not listed as a dependency in the package.json.

Solution:

Either decouple the browser and node ecdsa_signature.ts helpers and use a Uint8Array instance instead of Buffer or add the buffer dependency to the package.

Dominant language
TypeScript
Stars
260
Forks
68
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws/aws-encryption-sdk-javascript

All issues in aws/aws-encryption-sdk-javascript

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.