Fix openpgp.verify/decrypt with expectSigned: true and format: 'binary'#1805
Fix openpgp.verify/decrypt with expectSigned: true and format: 'binary'#1805twiss merged 1 commit intoopenpgpjs:mainfrom
openpgp.verify/decrypt with expectSigned: true and format: 'binary'#1805Conversation
7142a2f to
16c42ad
Compare
src/openpgp.js
Outdated
| result.data, | ||
| stream.fromAsync(async () => { | ||
| await util.anyPromise(result.signatures.map(sig => sig.verified)); | ||
| if (format === 'binary') return new Uint8Array(); |
There was a problem hiding this comment.
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...?)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Fine by me, I mostly care about consistent behavior, esp. thinking of the TS transition 🙂
16c42ad to
a168c10
Compare
Fix #1803.