grafana/k6

webcrypto: Throw exception on `saltLength: 0` for RSA PSS sign/verify

Open

#4,265 创建于 2024年10月30日

在 GitHub 查看
 (14 评论) (0 反应) (1 负责人)Go (30,564 star) (1,537 fork)batch import
area: webcryptogood first issuehelp wanted

描述

What?

While implementing support of RSA grafana/xk6-webcrypto#85 we've found that standard Golang's SDK doesn't provide support of the saltLength: 0, instead it always tries to generate salt with the maximum length.

This led us for the patch to WebPlatfrom tests: https://github.com/grafana/xk6-webcrypto/blob/main/webcrypto/tests/wpt-patches/WebCryptoAPI__sign_verify__rsa.js.patch

Since some use cases could actually try to use the lengths of salt 0 we need to issue a log warning user that the actual behavior of our implementation is different.

edit(@mstoykov): After some discussion the idea is currently to throw an exception instead of just log a warning.

Why?

It improves UX and makes implementation predictable.

贡献者指南