| commit | 7d0074ccc6f17acbf2ebb10db06d492e08f887dc | [log] [tgz] |
|---|---|---|
| author | Juergen Graf <juergen.graf@gmail.com> | Mon Dec 22 01:27:49 2025 +0000 |
| committer | Gopher Robot <gobot@golang.org> | Tue Jan 13 07:44:11 2026 -0800 |
| tree | 8ae802c545076b19fa5f72f44f8b303039aafa41 | |
| parent | 506e022208b864bc3c9c4a416fe56be75d10ad24 [diff] |
scrypt: fix panic on parameters <= 0 Providing 0 as argument for r or p results in a panic: panic: runtime error: integer divide by zero Providing negative values for r or p returns a misleading error: scrypt: parameters are too large This change avoids the panic and introduces a new error that is returned when r or p are <= 0: scrypt: parameters must be > 0 Change-Id: I68987b27d1eedd66644d2ec9436cba364fc1d46d Reviewed-on: https://go-review.googlesource.com/c/crypto/+/731780 Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Filippo Valsorda <filippo@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org>
This repository holds supplementary Go cryptography packages.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute.
The git repository is https://go.googlesource.com/crypto.
The main issue tracker for the crypto repository is located at https://go.dev/issues. Prefix your issue with “x/crypto:” in the subject line, so it is easy to find.
Note that contributions to the cryptography package receive additional scrutiny due to their sensitive nature. Patches may take longer than normal to receive feedback.