[ci skip] codex 5.3 review

This commit is contained in:
2026-02-06 15:07:44 +11:00
parent 5dcc11e5e0
commit dc96431f06
8 changed files with 179 additions and 339 deletions

View File

@@ -5,6 +5,7 @@ import (
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"log/slog"
)
@@ -68,6 +69,9 @@ func (s *Secrets) Decrypt(base64CipherText string) ([]byte, error) {
// Extract the nonce from the ciphertext
nonceSize := gcm.NonceSize()
if len(cipherText) < nonceSize {
return nil, fmt.Errorf("ciphertext is too short")
}
nonce, cipherText := cipherText[:nonceSize], cipherText[nonceSize:]
// Decrypt the ciphertext