sipeed/picoclaw · error

decode AES key: %w

Error message

decode AES key: %w

What it means

Error "decode AES key: %w" thrown in sipeed/picoclaw.

Source

Thrown at pkg/channels/wecom/media.go:96

			MediaID:     m.MediaID,
			Title:       m.Title,
			Description: m.Description,
		}
	}
	return body
}

func decodeMediaAESKey(value string) ([]byte, error) {
	if value == "" {
		return nil, nil
	}
	key, err := base64.StdEncoding.DecodeString(value)
	if err == nil && len(key) == 32 {
		return key, nil
	}
	key, err = base64.StdEncoding.DecodeString(value + "=")
	if err != nil {
		return nil, fmt.Errorf("decode AES key: %w", err)
	}
	if len(key) != 32 {
		return nil, fmt.Errorf("invalid AES key length %d", len(key))
	}
	return key, nil
}

func decryptAESCBC(key, ciphertext []byte) ([]byte, error) {
	if len(ciphertext) == 0 {
		return nil, fmt.Errorf("ciphertext is empty")
	}
	if len(ciphertext)%aes.BlockSize != 0 {
		return nil, fmt.Errorf("ciphertext length %d is not a multiple of block size", len(ciphertext))
	}
	block, err := aes.NewCipher(key)
	if err != nil {
		return nil, fmt.Errorf("create cipher: %w", err)
	}

View on GitHub (pinned to 49183d7e8d)

When it happens

Trigger: Thrown at pkg/channels/wecom/media.go:96 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/cc493936d68d5c7e. Report an issue: GitHub.