aboutsummaryrefslogtreecommitdiff
path: root/lib/libeclat.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-07-09 13:01:57 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2014-07-09 23:20:17 +0300
commit131b6ab56cbec838346fd493f3fe96438e3b58e7 (patch)
tree1a30a33f6447fcbeba9810542121dc7003d3129a /lib/libeclat.h
parent7f40bb8674983f8e4fc11fbebe56f88daa812c1a (diff)
downloadeclat-131b6ab56cbec838346fd493f3fe96438e3b58e7.tar.gz
eclat-131b6ab56cbec838346fd493f3fe96438e3b58e7.tar.bz2
Implement signature version 4 signing process
* lib/libeclat.h (ec2_param) <encoded>: New member. (ec2_query) <signature>: Remove. <headers,region,access_key>: New members (eclat_query_create): Take two more arguments. All uses changed. (eclat_query_add_param_encoded) (eclat_query_add_header): New functions. * lib/q2url.c (eclat_query_to_url): Don't create Signature param: it is already in the param list (for v2 process). * lib/qaddparm.c (eclat_query_add_param_encoded): New function. (eclat_query_add_header): New function. * lib/qcreat.c (eclat_query_create): Take region and access key as additional parameters. * lib/qencode.c (encode_param): Skip parameters that have encoded set to true. * lib/reqsign.c (querysign2): Store access key in AWSAccessKeyId and the generated signature in the Signature parameters. (eclat_hex_encode): New function. (querysign4): Implement signature version 4 signing process. * src/ec2map.c: Update call to eclat_query_create. * src/eclat.c: Likewise. * src/util.c (eclat_send_query): Sign the query and add requested headers prior to sending. * doc/eclat.conf.5: Document signature-version. * NEWS: Likewise.
Diffstat (limited to 'lib/libeclat.h')
-rw-r--r--lib/libeclat.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/libeclat.h b/lib/libeclat.h
index 51728e1..b7dc189 100644
--- a/lib/libeclat.h
+++ b/lib/libeclat.h
@@ -70,6 +70,7 @@ int eclat_base64_decode(const unsigned char *input, size_t input_len,
struct ec2_param {
char *name;
char *value;
+ int encoded;
};
#define EC2_API_VERSION "2013-02-01"
@@ -82,15 +83,22 @@ struct ec2_query {
char *endpoint; /* endpoint */
char *uri; /* URI without parameters */
struct grecs_symtab *params; /* Query parameters */
- char *signature;
+ struct grecs_list *headers; /* Query headers */
+ char *region;
+ char *access_key;
unsigned long ttl; /* Time-to-live in seconds */
};
struct ec2_query *eclat_query_create(int flags, const char *endpoint,
- const char *uri);
+ const char *uri, char const *region,
+ char const *access_key);
void eclat_query_free(struct ec2_query *);
void eclat_query_add_param(struct ec2_query *q, const char *name,
const char *value);
+void eclat_query_add_param_encoded(struct ec2_query *q, const char *name,
+ const char *value);
+void eclat_query_add_header(struct ec2_query *q, const char *name,
+ const char *value);
void eclat_query_sign(struct ec2_query *req, char *secret, char *version);

Return to:

Send suggestions and report system problems to the System administrator.