From ce46246a0930bd34878721758254cdf2638f064f Mon Sep 17 00:00:00 2001 From: Mikko Partio Date: Wed, 2 Sep 2020 14:18:26 +0300 Subject: [PATCH] Do not set authorization headers if access key id or secret access key is NULL --- src/request.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/request.c b/src/request.c index dd66863..50b1931 100644 --- a/src/request.c +++ b/src/request.c @@ -982,6 +982,13 @@ static S3Status compose_auth_header(const RequestParams *params, printf("--\nCanonical Request:\n%s\n", canonicalRequest); #endif + if (params->bucketContext.accessKeyId == NULL || params->bucketContext.secretAccessKey == NULL) { +#ifdef SIGNATURE_DEBUG + printf("--\nNo authorization header\n"); +#endif + return S3StatusOK; + } + len = 0; unsigned char canonicalRequestHash[S3_SHA256_DIGEST_LENGTH]; #ifdef __APPLE__