57 #ifdef H5_HAVE_ROS3_VFD
60 #include <curl/curl.h>
61 #include <openssl/evp.h>
62 #include <openssl/hmac.h>
63 #include <openssl/sha.h>
72 #define EMPTY_SHA256 \
73 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
78 #define ISO8601_SIZE 17
83 #define RFC7231_SIZE 30
101 #define ISO8601NOW(dest, now_gm) \
102 strftime((dest), ISO8601_SIZE, "%Y%m%dT%H%M%SZ", (now_gm))
120 #define RFC7231NOW(dest, now_gm) \
121 strftime((dest), RFC7231_SIZE, "%a, %d %b %Y %H:%M:%S GMT", (now_gm))
132 #define S3COMMS_MAX_CREDENTIAL_SIZE 155
165 #define S3COMMS_FORMAT_CREDENTIAL(dest, access, iso8601_date, region, service) \
166 HDsnprintf((dest), S3COMMS_MAX_CREDENTIAL_SIZE, \
167 "%s/%s/%s/%s/aws4_request", \
168 (access), (iso8601_date), (region), (service))
257 typedef struct hrb_node_t {
263 struct hrb_node_t *next;
265 #define S3COMMS_HRB_NODE_MAGIC 0x7F5757UL
338 hrb_node_t *first_header;
343 #define S3COMMS_HRB_MAGIC 0x6DCC84UL
406 #define S3COMMS_PARSED_URL_MAGIC 0x21D0DFUL
495 unsigned char *signing_key;
498 #define S3COMMS_S3R_MAGIC 0x44d8d79
518 H5_DLL hrb_t * H5FD_s3comms_hrb_init_request(
const char *verb,
519 const char *resource,
528 H5_DLL size_t H5FD_s3comms_s3r_get_filesize(s3r_t *handle);
530 H5_DLL s3r_t * H5FD_s3comms_s3r_open(
const char url[],
533 const unsigned char signing_key[]);
544 H5_DLL struct tm * gmnow(
void);
546 H5_DLL herr_t H5FD_s3comms_aws_canonical_request(
char *canonical_request_dest,
548 char *signed_headers_dest,
550 hrb_t *http_request);
553 const unsigned char *msg,
557 H5_DLL herr_t H5FD_s3comms_free_purl(parsed_url_t *purl);
559 H5_DLL herr_t H5FD_s3comms_HMAC_SHA256(
const unsigned char *key,
565 H5_DLL herr_t H5FD_s3comms_load_aws_profile(
const char *name,
567 char *secret_access_key_out,
568 char *aws_region_out);
575 parsed_url_t **purl);
577 H5_DLL herr_t H5FD_s3comms_percent_encode_char(
char *repr,
578 const unsigned char c,
581 H5_DLL herr_t H5FD_s3comms_signing_key(
unsigned char *md,
584 const char *iso8601now);
596 H5_DLL herr_t H5FD_s3comms_uriencode(
char *dest,
const char *s,
size_t s_len,
597 hbool_t encode_slash,
size_t *n_written);