aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/s3_validation_utils.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2025-10-27 23:04:55 -0700
committerchrislu <chris.lu@gmail.com>2025-10-27 23:04:55 -0700
commitb7ba6785a2252f7a9c0e5192431b97e384034771 (patch)
treeb63b42437212683ba6583736030c8cf915421a86 /weed/s3api/s3_validation_utils.go
parent208d7f24f46fead096fd92432b90ebee7c406216 (diff)
downloadseaweedfs-b7ba6785a2252f7a9c0e5192431b97e384034771.tar.xz
seaweedfs-b7ba6785a2252f7a9c0e5192431b97e384034771.zip
go fmt
Diffstat (limited to 'weed/s3api/s3_validation_utils.go')
-rw-r--r--weed/s3api/s3_validation_utils.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/weed/s3api/s3_validation_utils.go b/weed/s3api/s3_validation_utils.go
index e0e80d0a8..f69fc9c26 100644
--- a/weed/s3api/s3_validation_utils.go
+++ b/weed/s3api/s3_validation_utils.go
@@ -71,7 +71,7 @@ func ValidateSSES3Key(sseKey *SSES3Key) error {
if sseKey == nil {
return fmt.Errorf("SSE-S3 key cannot be nil")
}
-
+
// Validate key bytes
if sseKey.Key == nil {
return fmt.Errorf("SSE-S3 key bytes cannot be nil")
@@ -79,22 +79,22 @@ func ValidateSSES3Key(sseKey *SSES3Key) error {
if len(sseKey.Key) != SSES3KeySize {
return fmt.Errorf("invalid SSE-S3 key size: expected %d bytes, got %d", SSES3KeySize, len(sseKey.Key))
}
-
+
// Validate algorithm
if sseKey.Algorithm != SSES3Algorithm {
return fmt.Errorf("invalid SSE-S3 algorithm: expected %q, got %q", SSES3Algorithm, sseKey.Algorithm)
}
-
+
// Validate key ID (should not be empty)
if sseKey.KeyID == "" {
return fmt.Errorf("SSE-S3 key ID cannot be empty")
}
-
+
// IV validation is optional during key creation - it will be set during encryption
// If IV is set, validate its length
if len(sseKey.IV) > 0 && len(sseKey.IV) != s3_constants.AESBlockSize {
return fmt.Errorf("invalid SSE-S3 IV length: expected %d bytes, got %d", s3_constants.AESBlockSize, len(sseKey.IV))
}
-
+
return nil
}