Skip to content

Conversation

twiss
Copy link
Member

@twiss twiss commented Nov 7, 2024

Fix #1803.

@twiss twiss requested a review from larabr November 7, 2024 15:50
@twiss twiss force-pushed the fix-expectSigned-binary branch from 7142a2f to 16c42ad Compare November 7, 2024 15:58
src/openpgp.js Outdated
result.data,
stream.fromAsync(async () => {
await util.anyPromise(result.signatures.map(sig => sig.verified));
if (format === 'binary') return new Uint8Array();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd have this return '' explicitly for string streams as well (and separately, I'd consider having the stream helpers be stricter with type checks and actually throw when e.g. joining undefined chunks in a stream string, wdyt...?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sort of agree but at the same time, I think it would be useful to formally support undefined in web-stream-tools, and just make them a no-op (ignore them when writing), that way we don't have to concatenate another value. This was just the quickest fix until that's done.
But yeah, until we have that we can return '' as well.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me, I mostly care about consistent behavior, esp. thinking of the TS transition 🙂

@twiss twiss force-pushed the fix-expectSigned-binary branch from 16c42ad to a168c10 Compare November 8, 2024 14:15
@twiss twiss requested a review from larabr November 8, 2024 14:15
@twiss twiss merged commit ac1bfc0 into openpgpjs:main Nov 11, 2024
13 checks passed
@twiss twiss deleted the fix-expectSigned-binary branch November 11, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failing to decrypt messages in binary format when using expectSigned: true

2 participants