google / google/webcrypto.dart

Ensure CBS is empty after importing keys

Open
#60 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Dart
Stars
116
Forks
110
Avg merge
6d 8h
Merged PRs (30d)
9

Description

Whenever we create a CBS object, it's usually because we're feeding some data into BoringCrypto. If all the data is not read, this usually indicates invalid data. If importing a key doesn't consume all the bytes supplied in the key, we should probably reject it.

This needs test cases to ensure compatibility with web implementations.

Look code referencing`Scope.createCBS` those places probably have to check that CBS is empty after it's been processed.

This requires testing of invalid key bytes, so probably blocked by https://github.com/google/webcrypto.dart/issues/55

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.