diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2019-10-25 20:04:37 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-10-25 20:04:37 +0000 |
commit | c801d7cca46f020a08d38e0e541d8e981b8649e0 (patch) | |
tree | ab2ee3adf9dd8e1c5001b4334b5ed75d4c8c3497 /src/mongo/shell/kms_aws.cpp | |
parent | a54df9e45d85a670bc4dc40339d76347865fab69 (diff) | |
download | mongo-c801d7cca46f020a08d38e0e541d8e981b8649e0.tar.gz |
SERVER-44133 Refactor kms memory allocation to header file
Diffstat (limited to 'src/mongo/shell/kms_aws.cpp')
-rw-r--r-- | src/mongo/shell/kms_aws.cpp | 51 |
1 files changed, 1 insertions, 50 deletions
diff --git a/src/mongo/shell/kms_aws.cpp b/src/mongo/shell/kms_aws.cpp index 34b185a4f62..911269b8e11 100644 --- a/src/mongo/shell/kms_aws.cpp +++ b/src/mongo/shell/kms_aws.cpp @@ -42,6 +42,7 @@ #include "mongo/shell/kms.h" #include "mongo/shell/kms_gen.h" #include "mongo/util/base64.h" +#include "mongo/util/kms_message_support.h" #include "mongo/util/log.h" #include "mongo/util/net/hostandport.h" #include "mongo/util/net/sock.h" @@ -54,56 +55,6 @@ namespace mongo { namespace { /** - * Free kms_request_t - */ -struct kms_request_tFree { - void operator()(kms_request_t* p) noexcept { - if (p) { - ::kms_request_destroy(p); - } - } -}; - -using UniqueKmsRequest = std::unique_ptr<kms_request_t, kms_request_tFree>; - -/** - * Free kms_response_parser_t - */ -struct kms_response_parser_tFree { - void operator()(kms_response_parser_t* p) noexcept { - if (p) { - ::kms_response_parser_destroy(p); - } - } -}; - -using UniqueKmsResponseParser = std::unique_ptr<kms_response_parser_t, kms_response_parser_tFree>; - -/** - * Free kms_response_t - */ -struct kms_response_tFree { - void operator()(kms_response_t* p) noexcept { - if (p) { - ::kms_response_destroy(p); - } - } -}; - -using UniqueKmsResponse = std::unique_ptr<kms_response_t, kms_response_tFree>; - -/** - * Free kms_char_buffer - */ -struct kms_char_free { - void operator()(char* x) { - kms_request_free_string(x); - } -}; - -using UniqueKmsCharBuffer = std::unique_ptr<char, kms_char_free>; - -/** * Make a request to a AWS HTTP endpoint. * * Does not maintain a persistent HTTP connection. |