Accumulating milestone branch. One squashed commit per closed issue; `next` is kept green and mergeable to `main` at any time without notice. Landed so far: - `chore: update golangci-lint to v2.12.2 with canonical config` (#54) — canonical v2-schema `.golangci.yml`, pins bumped in `Dockerfile` and `script/bootstrap`, tree at `0 issues.`. Three behaviour deltas are recorded in that PR's body: `Cache.StoreVariant` takes a context, `MetadataStorage.Store` no longer leaks temp files on failure, and the `signing_key` too-short error text gained a `value too short:` prefix. Sequencing for the milestone is tracked in #103. Reviewed-on: #105 Co-authored-by: clawbot <clawbot@noreply.example.org>
This commit was merged in pull request #105.
This commit is contained in:
@@ -34,7 +34,8 @@ func DeriveKey(masterKey []byte, salt string) ([KeySize]byte, error) {
|
||||
|
||||
hkdfReader := hkdf.New(sha256.New, masterKey, []byte(salt), nil)
|
||||
|
||||
if _, err := io.ReadFull(hkdfReader, key[:]); err != nil {
|
||||
_, err := io.ReadFull(hkdfReader, key[:])
|
||||
if err != nil {
|
||||
return key, ErrKeyDerivation
|
||||
}
|
||||
|
||||
@@ -46,7 +47,9 @@ func DeriveKey(masterKey []byte, salt string) ([KeySize]byte, error) {
|
||||
func Encrypt(key [KeySize]byte, plaintext []byte) (string, error) {
|
||||
// Generate random nonce
|
||||
var nonce [NonceSize]byte
|
||||
if _, err := rand.Read(nonce[:]); err != nil {
|
||||
|
||||
_, err := rand.Read(nonce[:])
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user