From abdbb2ab5b028ab59dc3b0e04fe256a55684c792 Mon Sep 17 00:00:00 2001 From: Francesco Cozzuto Date: Mon, 1 Dec 2025 14:00:26 +0100 Subject: [PATCH] Add script spawn minio server to test the URLs against it --- .gitignore | 1 + Makefile | 2 +- s3.c | 2 ++ test.c | 6 +++--- test.sh | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 test.sh diff --git a/.gitignore b/.gitignore index 35ccb46..dfb1cf9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ test test.exe +minio diff --git a/Makefile b/Makefile index 867595d..a941057 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -ifeq ($(shell uname -a),Linux) +ifeq ($(shell uname -s),Linux) LFLAGS = -lcrypto else LFLAGS = -lbcrypt diff --git a/s3.c b/s3.c index 8f9da42..f07a6ee 100644 --- a/s3.c +++ b/s3.c @@ -241,6 +241,8 @@ static int inplace_hmac(char *buf, int len1, int len2) BCryptCloseAlgorithmProvider(alg, 0); return 0; #else + int olen = hmac_len(buf, len1, len2); + EVP_MAC *mac = EVP_MAC_fetch(NULL, "HMAC", NULL); if (mac == NULL) { return -1; diff --git a/test.c b/test.c index 0218c01..5d7587a 100644 --- a/test.c +++ b/test.c @@ -10,11 +10,11 @@ int main(void) S3_S("GET"), 3600, S3_S(""), - S3_S("accesskey"), - S3_S("secretkey"), + S3_S("minioadmin"), + S3_S("minioadmin"), S3_S("us-west-1"), S3_S("s3"), - S3_S("aws.com"), + S3_S("172.17.0.2:9000"), time(NULL), dst, sizeof(dst)); if (len < 0) { diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..f764841 --- /dev/null +++ b/test.sh @@ -0,0 +1 @@ +docker run -p 9000:9000 -e MINIO_ROOT_USER=minioadmin -e MINIO_ROOT_PASSWORD=minioadmin minio/minio server /data