浏览代码

Issue 2403 – Support long AWS/S3 session tokens

https://winscp.net/tracker/2403

Source commit: e75ee4a242b07c4c1deab2fbf2f996b53892d349
Martin Prikryl 1 周之前
父节点
当前提交
d56df35b34
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 4 1
      libs/libs3/inc/libs3.h
  2. 1 1
      source/forms/SiteAdvanced.dfm

+ 4 - 1
libs/libs3/inc/libs3.h

@@ -160,7 +160,10 @@ extern "C" {
  * S3_MAX_METADATA_SIZE is the maximum number of bytes allowed for
  * x-amz-meta header names and values in any request passed to Amazon S3
  **/
-#define S3_MAX_METADATA_SIZE               2048
+// WINSCP: Session token can have any size, but the documentation explicitly mentions 4096 bytes:
+// https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html
+// AWS itself does not support headers larger than 8192 (returns RequestHeaderSectionTooLarge)
+#define S3_MAX_METADATA_SIZE               8192
 
 
 /**

+ 1 - 1
source/forms/SiteAdvanced.dfm

@@ -1169,7 +1169,7 @@ object SiteAdvancedDialog: TSiteAdvancedDialog
             Width = 419
             Height = 93
             Anchors = [akLeft, akTop, akRight]
-            MaxLength = 10000
+            MaxLength = 4096
             TabOrder = 0
             OnChange = DataChange
             OnKeyDown = NoteMemoKeyDown