| 1 |
#ifndef AWS_AUTH_SIGNING_SIGV4_H |
| 2 |
#define AWS_AUTH_SIGNING_SIGV4_H |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#include <aws/auth/auth.h> |
| 10 |
#include <aws/auth/signing.h> |
| 11 |
#include <aws/auth/signing_result.h> |
| 12 |
|
| 13 |
#include <aws/common/byte_buf.h> |
| 14 |
#include <aws/common/hash_table.h> |
| 15 |
|
| 16 |
struct aws_ecc_key_pair; |
| 17 |
struct aws_signable; |
| 18 |
struct aws_signing_config_aws; |
| 19 |
struct aws_signing_result; |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
struct aws_signing_state_aws { |
| 33 |
struct aws_allocator *allocator; |
| 34 |
|
| 35 |
const struct aws_signable *signable; |
| 36 |
aws_signing_complete_fn *on_complete; |
| 37 |
void *userdata; |
| 38 |
|
| 39 |
struct aws_signing_config_aws config; |
| 40 |
struct aws_byte_buf config_string_buffer; |
| 41 |
|
| 42 |
struct aws_signing_result result; |
| 43 |
int error_code; |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
struct aws_byte_buf canonical_request; |
| 50 |
struct aws_byte_buf string_to_sign; |
| 51 |
struct aws_byte_buf signed_headers; |
| 52 |
struct aws_byte_buf canonical_header_block; |
| 53 |
struct aws_byte_buf payload_hash; |
| 54 |
struct aws_byte_buf credential_scope; |
| 55 |
struct aws_byte_buf access_credential_scope; |
| 56 |
struct aws_byte_buf date; |
| 57 |
struct aws_byte_buf signature; |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
struct aws_byte_buf string_to_sign_payload; |
| 62 |
|
| 63 |
|
| 64 |
struct aws_byte_buf scratch_buf; |
| 65 |
|
| 66 |
char expiration_array[32]; |
| 67 |
}; |
| 68 |
|
| 69 |
AWS_EXTERN_C_BEGIN |
| 70 |
|
| 71 |
AWS_AUTH_API |
| 72 |
struct aws_signing_state_aws *aws_signing_state_new( |
| 73 |
struct aws_allocator *allocator, |
| 74 |
const struct aws_signing_config_aws *config, |
| 75 |
const struct aws_signable *signable, |
| 76 |
aws_signing_complete_fn *on_complete, |
| 77 |
void *userdata); |
| 78 |
|
| 79 |
AWS_AUTH_API |
| 80 |
void aws_signing_state_destroy(struct aws_signing_state_aws *state); |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
AWS_AUTH_API |
| 94 |
int aws_signing_build_canonical_request(struct aws_signing_state_aws *state); |
| 95 |
|
| 96 |
AWS_AUTH_API |
| 97 |
int aws_signing_build_string_to_sign(struct aws_signing_state_aws *state); |
| 98 |
|
| 99 |
AWS_AUTH_API |
| 100 |
int aws_signing_build_authorization_value(struct aws_signing_state_aws *state); |
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
AWS_AUTH_API extern const struct aws_string *g_aws_signing_content_header_name; |
| 107 |
AWS_AUTH_API extern const struct aws_string *g_aws_signing_algorithm_query_param_name; |
| 108 |
AWS_AUTH_API extern const struct aws_string *g_aws_signing_credential_query_param_name; |
| 109 |
AWS_AUTH_API extern const struct aws_string *g_aws_signing_date_name; |
| 110 |
AWS_AUTH_API extern const struct aws_string *g_aws_signing_signed_headers_query_param_name; |
| 111 |
AWS_AUTH_API extern const struct aws_string *g_aws_signing_security_token_name; |
| 112 |
AWS_AUTH_API extern const struct aws_string *g_aws_signing_s3session_token_name; |
| 113 |
AWS_AUTH_API extern const struct aws_string *g_signature_type_sigv4a_http_request; |
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
AWS_AUTH_API |
| 119 |
int aws_signing_init_signing_tables(struct aws_allocator *allocator); |
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
AWS_AUTH_API |
| 125 |
void aws_signing_clean_up_signing_tables(void); |
| 126 |
|
| 127 |
AWS_EXTERN_C_END |
| 128 |
|
| 129 |
#endif |