crypto: fix webcrypto private/secret import with empty usages#47877
crypto: fix webcrypto private/secret import with empty usages#47877nodejs-github-bot merged 2 commits intonodejs:mainfrom
Conversation
|
Review requested:
|
|
How do we deal with the semverness of this? The keys were unusable before, they are non-importable now. It is unlikely any code depended on import of keys that weren't usable for any operation but I'm keen to get more opinions. |
Furthermore if any interoperable code uses webcrypto (kinda its whole point) it already can't depend on this as other implementations properly reject. I'm proposing to ship this is as a fix not as a breaking change. |
|
I'd expect near-zero breakage, so spec-compliance outweighs that concern. |
|
In that case this is ready for reviews. |
| } | ||
|
|
||
| throw lazyDOMException('Unrecognized algorithm name', 'NotSupportedError'); | ||
| if ((result.type === 'secret' || result.type === 'private') && result.usages.length === 0) { |
There was a problem hiding this comment.
| if ((result.type === 'secret' || result.type === 'private') && result.usages.length === 0) { | |
| if (result.type !== 'public' && result.usages.length === 0) { |
|
Landed in 71eda57 |
Refs: #47864 PR-URL: #47877 Refs: #47864 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Refs: nodejs#47864 PR-URL: nodejs#47877 Refs: nodejs#47864 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]> Backport-PR-URL: nodejs#47336
Refs: #47864 PR-URL: #47877 Refs: #47864 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Refs: nodejs#47864 PR-URL: nodejs#47877 Refs: nodejs#47864 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
privateandsecrettype keys are not allowed to have empty usagesRefs: #47864
cc @tniessen @fhanau