diff options
Diffstat (limited to 'src/third_party/kms-message/src/kms_message')
12 files changed, 0 insertions, 790 deletions
diff --git a/src/third_party/kms-message/src/kms_message/kms_azure_request.h b/src/third_party/kms-message/src/kms_message/kms_azure_request.h deleted file mode 100644 index 2e9af68fd03..00000000000 --- a/src/third_party/kms-message/src/kms_message/kms_azure_request.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2020-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef KMS_AZURE_REQUEST_H -#define KMS_AZURE_REQUEST_H - -#include "kms_message_defines.h" -#include "kms_request.h" -#include "kms_request_opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Constructs an oauth client credentials grant request for Azure. - * See - * https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow#get-a-token. - * - * Parameters: - * All parameters must be NULL terminated strings. - * - host: The value of the Host header. This should be a custom host or - * "login.microsoftonline.com". - * - scope: The oauth scope. This should be a custom scope or - * "https%3A%2F%2Fvault.azure.net%2F.default". Must be URL encoded. - * - tenant_id: The Azure tenant ID. - * - client_id: The client ID to authenticate. - * - client_secret: The client secret to authenticate. - * - opt: Additional options. This must have the Azure provider set via - * kms_request_opt_set_provider. - * - * Returns: A new kms_request_t. - * Always returns a new kms_request_t, even on error. - * Caller must check if an error occurred by calling kms_request_get_error. - */ -KMS_MSG_EXPORT (kms_request_t *) -kms_azure_request_oauth_new (const char *host, - const char *scope, - const char *tenant_id, - const char *client_id, - const char *client_secret, - const kms_request_opt_t *opt); - -/* Constructs a wrapkey request for Azure. - * See https://docs.microsoft.com/en-us/rest/api/keyvault/wrapkey/wrapkey - * - * Parameters: - * All parameters must be NULL terminated strings. - * - host: The value of the Host header, like "mykeyvault.vault.azure.net". - * - access_token: The access_token obtained from an oauth response as a - * base64url encoded string. - * - key_name: The azure key name. - * - key_version: An optional key version. May be NULL or empty string. - * - plaintext: The plaintext key to encrypt. - * - plaintext_len: The number of bytes of plaintext. - * - opt: Additional options. This must have the Azure provider set via - * kms_request_opt_set_provider. - */ - -KMS_MSG_EXPORT (kms_request_t *) -kms_azure_request_wrapkey_new (const char *host, - const char *access_token, - const char *key_name, - const char *key_version, - const uint8_t *plaintext, - size_t plaintext_len, - const kms_request_opt_t *opt); - -/* Constructs an unwrapkey request for Azure. - * See https://docs.microsoft.com/en-us/rest/api/keyvault/unwrapkey/unwrapkey - * - * Parameters: - * All parameters must be NULL terminated strings. - * - host: The value of the Host header, like "mykeyvault.vault.azure.net". - * - access_token: The access_token obtained from an oauth response as a - * base64url encoded string. - * - key_name: The azure key name. - * - key_version: An optional key version. May be NULL or empty string. - * - ciphertext: The ciphertext key to decrypt. - * - ciphertext_len: The number of bytes of ciphertext. - * - opt: Additional options. This must have the Azure provider set via - * kms_request_opt_set_provider. - */ - -KMS_MSG_EXPORT (kms_request_t *) -kms_azure_request_unwrapkey_new (const char *host, - const char *access_token, - const char *key_name, - const char *key_version, - const uint8_t *ciphertext, - size_t ciphertext_len, - const kms_request_opt_t *opt); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* KMS_AZURE_REQUEST_H */ diff --git a/src/third_party/kms-message/src/kms_message/kms_b64.h b/src/third_party/kms-message/src/kms_message/kms_b64.h deleted file mode 100644 index f0845cd331e..00000000000 --- a/src/third_party/kms-message/src/kms_message/kms_b64.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2018-present MongoDB Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef KMS_MESSAGE_B64_H -#define KMS_MESSAGE_B64_H - -#include "kms_message.h" - -#include <stddef.h> -#include <stdint.h> - -#ifdef __cplusplus -extern "C" { -#endif - -KMS_MSG_EXPORT (void) -kms_message_b64_initialize_rmap (void); - -KMS_MSG_EXPORT (int) -kms_message_b64_ntop (uint8_t const *src, - size_t srclength, - char *target, - size_t targsize); - -KMS_MSG_EXPORT (int) -kms_message_b64_pton (char const *src, uint8_t *target, size_t targsize); - -/* src and target may be the same string. Assumes no whitespace in src. */ -KMS_MSG_EXPORT (int) -kms_message_b64_to_b64url (const char *src, - size_t srclength, - char *target, - size_t targsize); -KMS_MSG_EXPORT (int) -kms_message_b64url_to_b64 (const char *src, - size_t srclength, - char *target, - size_t targsize); - -/* Convenience conversions which return copies. */ -char * -kms_message_raw_to_b64 (const uint8_t *raw, size_t raw_len); - -uint8_t * -kms_message_b64_to_raw (const char *b64, size_t *out); - -char * -kms_message_raw_to_b64url (const uint8_t *raw, size_t raw_len); - -uint8_t * -kms_message_b64url_to_raw (const char *b64url, size_t *out); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* KMS_MESSAGE_B64_H */ diff --git a/src/third_party/kms-message/src/kms_message/kms_caller_identity_request.h b/src/third_party/kms-message/src/kms_message/kms_caller_identity_request.h deleted file mode 100644 index 9f48e534235..00000000000 --- a/src/third_party/kms-message/src/kms_message/kms_caller_identity_request.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef KMS_CALLER_IDENTITY_REQUEST_H -#define KMS_CALLER_IDENTITY_REQUEST_H - -#include "kms_message_defines.h" -#include "kms_request.h" -#include "kms_request_opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -KMS_MSG_EXPORT (kms_request_t *) -kms_caller_identity_request_new (const kms_request_opt_t *opt); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - - -#endif /* KMS_CALLER_IDENTITY_REQUEST_H */ diff --git a/src/third_party/kms-message/src/kms_message/kms_decrypt_request.h b/src/third_party/kms-message/src/kms_message/kms_decrypt_request.h deleted file mode 100644 index db18d5f5e1c..00000000000 --- a/src/third_party/kms-message/src/kms_message/kms_decrypt_request.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2018-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef KMS_DECRYPT_REQUEST_H -#define KMS_DECRYPT_REQUEST_H - -#include "kms_message_defines.h" -#include "kms_request.h" -#include "kms_request_opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -KMS_MSG_EXPORT (kms_request_t *) -kms_decrypt_request_new (const uint8_t *ciphertext_blob, - size_t len, - const kms_request_opt_t *opt); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* KMS_DECRYPT_REQUEST_H */ diff --git a/src/third_party/kms-message/src/kms_message/kms_encrypt_request.h b/src/third_party/kms-message/src/kms_message/kms_encrypt_request.h deleted file mode 100644 index 601ee36297f..00000000000 --- a/src/third_party/kms-message/src/kms_message/kms_encrypt_request.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2018-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef KMS_ENCRYPT_REQUEST_H -#define KMS_ENCRYPT_REQUEST_H - -#include "kms_message_defines.h" -#include "kms_request.h" -#include "kms_request_opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -KMS_MSG_EXPORT (kms_request_t *) -kms_encrypt_request_new (const uint8_t *plaintext, - size_t plaintext_length, - const char *key_id, - const kms_request_opt_t *opt); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - - -#endif /* KMS_ENCRYPT_REQUEST_H */ diff --git a/src/third_party/kms-message/src/kms_message/kms_gcp_request.h b/src/third_party/kms-message/src/kms_message/kms_gcp_request.h deleted file mode 100644 index 1d1555fb0c6..00000000000 --- a/src/third_party/kms-message/src/kms_message/kms_gcp_request.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2020-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef KMS_GCP_REQUEST_H -#define KMS_GCP_REQUEST_H - -#include "kms_message_defines.h" -#include "kms_request.h" -#include "kms_request_opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Constructs an oauth client credentials request for GCP. - * See https://developers.google.com/identity/protocols/oauth2/service-account - * - * Parameters: - * - host: The host header, like "oauth2.googleapis.com". - * - email: The email for the service account to authenticate. - * - audience: The "aud" field in the JSON Web Token (JWT). Should be a URL - * like "https://oauth2.googleapis.com/token" - * - scope: The "scope" field in the JSON Web Token (JWT). Should be a URL - * like "https://www.googleapis.com/auth/cloudkms". - * - private_key_data: Bytes pointing to a PKCS#8 private key. - * - private_key_len: The length of private_key_data. - * - opt: Request options. The provider must be set to KMS_REQUEST_PROVIDER_GCP - * with kms_request_opt_set_provider. Callers that want to use a custom crypto - * callback to sign the request should set the callback on opt with - * kms_request_opt_set_crypto_hook_rsaes_pkcs1_v1_5. - * - * Returns: A new kms_request_t. - * Always returns a new kms_request_t, even on error. - * Caller must check if an error occurred by calling kms_request_get_error. - */ -KMS_MSG_EXPORT (kms_request_t *) -kms_gcp_request_oauth_new (const char *host, - const char *email, - const char *audience, - const char *scope, - const char *private_key_data, - size_t private_key_len, - const kms_request_opt_t *opt); - -/* Constructs the encrypt request for GCP. - * See - * https://cloud.google.com/kms/docs/encrypt-decrypt#kms-encrypt-symmetric-api - * - * Parameters: - * - host: The value of the Host header, like "cloudkms.googleapis.com". - * - project_id: The project id. - * - location: The location id, like "global". - * - key_ring_name: The key ring name. - * - key_name: The key name. - * - key_version: The optional key version. May be NULL. - * - plaintext: The plaintext key to encrypt. - * - plaintext_len: The number of bytes of plaintext. - * - opt: Request options. The provider must be set to KMS_REQUEST_PROVIDER_GCP - * with kms_request_opt_set_provider. - * - * Returns: A new kms_request_t. - * Always returns a new kms_request_t, even on error. - * Caller must check if an error occurred by calling kms_request_get_error. - */ -KMS_MSG_EXPORT (kms_request_t *) -kms_gcp_request_encrypt_new (const char *host, - const char *access_token, - const char *project_id, - const char *location, - const char *key_ring_name, - const char *key_name, - const char *key_version, - const uint8_t *plaintext, - size_t plaintext_len, - const kms_request_opt_t *opt); - -/* Constructs the decrypt request for GCP. - * See - * https://cloud.google.com/kms/docs/encrypt-decrypt#kms-decrypt-symmetric-api - * - * Parameters: - * - host: The value of the Host header, like "cloudkms.googleapis.com". - * - project_id: The project id. - * - location: The location id, like "global". - * - key_ring_name: The key ring name. - * - key_name: The key name. - * - ciphertext: The ciphertext key to encrypt. - * - ciphertext_len: The number of bytes of ciphertext. - * - opt: Request options. The provider must be set to KMS_REQUEST_PROVIDER_GCP - * with kms_request_opt_set_provider. - * - * Returns: A new kms_request_t. - * Always returns a new kms_request_t, even on error. - * Caller must check if an error occurred by calling kms_request_get_error. - */ -KMS_MSG_EXPORT (kms_request_t *) -kms_gcp_request_decrypt_new (const char *host, - const char *access_token, - const char *project_id, - const char *location, - const char *key_ring_name, - const char *key_name, - const uint8_t *ciphertext, - size_t ciphertext_len, - const kms_request_opt_t *opt); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* KMS_GCP_REQUEST_H */ diff --git a/src/third_party/kms-message/src/kms_message/kms_message.h b/src/third_party/kms-message/src/kms_message/kms_message.h deleted file mode 100644 index 8048528f2e0..00000000000 --- a/src/third_party/kms-message/src/kms_message/kms_message.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2018-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef KMS_MESSAGE_H -#define KMS_MESSAGE_H - -#include <sys/types.h> - -#include "kms_message_defines.h" -#include "kms_request_opt.h" -#include "kms_request.h" -#include "kms_response.h" -#include "kms_response_parser.h" -#include "kms_caller_identity_request.h" -#include "kms_decrypt_request.h" -#include "kms_encrypt_request.h" - -#endif /* KMS_MESSAGE_H */ diff --git a/src/third_party/kms-message/src/kms_message/kms_message_defines.h b/src/third_party/kms-message/src/kms_message/kms_message_defines.h deleted file mode 100644 index a539d531ef6..00000000000 --- a/src/third_party/kms-message/src/kms_message/kms_message_defines.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2018-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef KMS_MESSAGE_DEFINES_H -#define KMS_MESSAGE_DEFINES_H - - -#ifdef _MSC_VER -#ifdef KMS_MSG_STATIC -#define KMS_MSG_API -#elif defined(KMS_MSG_COMPILATION) -#define KMS_MSG_API __declspec(dllexport) -#else -#define KMS_MSG_API __declspec(dllimport) -#endif -#define KMS_MSG_CALL __cdecl -#elif defined(__GNUC__) -#ifdef KMS_MSG_STATIC -#define KMS_MSG_API -#elif defined(KMS_MSG_COMPILATION) -#define KMS_MSG_API __attribute__ ((visibility ("default"))) -#else -#define KMS_MSG_API -#endif -#define KMS_MSG_CALL -#endif - -#define KMS_MSG_EXPORT(type) KMS_MSG_API type KMS_MSG_CALL - -#ifdef __cplusplus -extern "C" { -#endif - -KMS_MSG_EXPORT (int) -kms_message_init (void); -KMS_MSG_EXPORT (void) -kms_message_cleanup (void); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#ifdef _MSC_VER -#include <basetsd.h> -#pragma warning(disable : 4142) -#ifndef _SSIZE_T_DEFINED -#define _SSIZE_T_DEFINED -typedef SSIZE_T ssize_t; -#endif -#pragma warning(default : 4142) -#endif - -#endif /* KMS_MESSAGE_DEFINES_H */ diff --git a/src/third_party/kms-message/src/kms_message/kms_request.h b/src/third_party/kms-message/src/kms_message/kms_request.h deleted file mode 100644 index 0428c813491..00000000000 --- a/src/third_party/kms-message/src/kms_message/kms_request.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2018-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef KMS_REQUEST_H -#define KMS_REQUEST_H - -#include "kms_message_defines.h" -#include "kms_request_opt.h" - -#include <stdbool.h> -#include <stdint.h> -#include <stdlib.h> -#include <time.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* A KMS request is general enough to create arbitrary HTTP requests, but also - * supports generating AWS signature v4. */ -typedef struct _kms_request_t kms_request_t; - -KMS_MSG_EXPORT (kms_request_t *) -kms_request_new (const char *method, - const char *path_and_query, - const kms_request_opt_t *opt); -KMS_MSG_EXPORT (void) -kms_request_destroy (kms_request_t *request); -KMS_MSG_EXPORT (const char *) -kms_request_get_error (kms_request_t *request); - -/* Begin: AWS specific */ -KMS_MSG_EXPORT (bool) -kms_request_set_date (kms_request_t *request, const struct tm *tm); -KMS_MSG_EXPORT (bool) -kms_request_set_region (kms_request_t *request, const char *region); -KMS_MSG_EXPORT (bool) -kms_request_set_service (kms_request_t *request, const char *service); -KMS_MSG_EXPORT (bool) -kms_request_set_access_key_id (kms_request_t *request, const char *akid); -KMS_MSG_EXPORT (bool) -kms_request_set_secret_key (kms_request_t *request, const char *key); -/* End: AWS specific */ - -KMS_MSG_EXPORT (bool) -kms_request_add_header_field (kms_request_t *request, - const char *field_name, - const char *value); -KMS_MSG_EXPORT (bool) -kms_request_append_header_field_value (kms_request_t *request, - const char *value, - size_t len); -KMS_MSG_EXPORT (bool) -kms_request_append_payload (kms_request_t *request, - const char *payload, - size_t len); - -/* Begin: AWS specific */ -KMS_MSG_EXPORT (char *) -kms_request_get_canonical (kms_request_t *request); - -KMS_MSG_EXPORT (const char *) -kms_request_get_canonical_header (kms_request_t *request, const char *header); - -KMS_MSG_EXPORT (char *) -kms_request_get_string_to_sign (kms_request_t *request); -KMS_MSG_EXPORT (bool) -kms_request_get_signing_key (kms_request_t *request, unsigned char *key); -KMS_MSG_EXPORT (char *) -kms_request_get_signature (kms_request_t *request); -KMS_MSG_EXPORT (char *) -kms_request_get_signed (kms_request_t *request); -/* End: AWS specific */ - -KMS_MSG_EXPORT (void) -kms_request_free_string (char *ptr); - -/* Finalize and obtain a plain HTTP request (no signing). */ -KMS_MSG_EXPORT (char *) kms_request_to_string (kms_request_t *request); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* KMS_REQUEST_H */ diff --git a/src/third_party/kms-message/src/kms_message/kms_request_opt.h b/src/third_party/kms-message/src/kms_message/kms_request_opt.h deleted file mode 100644 index 74a3fb69771..00000000000 --- a/src/third_party/kms-message/src/kms_message/kms_request_opt.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2018-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef KMS_REQUEST_OPT_H -#define KMS_REQUEST_OPT_H - -#include "kms_message_defines.h" - -#include <stdbool.h> -#include <stdlib.h> - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct _kms_request_opt_t kms_request_opt_t; - -typedef size_t kms_request_provider_t; - -#define KMS_REQUEST_PROVIDER_AWS 0 -#define KMS_REQUEST_PROVIDER_AZURE 1 -#define KMS_REQUEST_PROVIDER_GCP 2 - -KMS_MSG_EXPORT (kms_request_opt_t *) -kms_request_opt_new (void); - -/* The default provider is AWS. This will automatically set extra headers. - * Returns false if provider is invalid. */ -KMS_MSG_EXPORT (bool) -kms_request_opt_set_provider (kms_request_opt_t *opt, - kms_request_provider_t provider); -KMS_MSG_EXPORT (void) -kms_request_opt_destroy (kms_request_opt_t *request); -KMS_MSG_EXPORT (void) -kms_request_opt_set_connection_close (kms_request_opt_t *opt, - bool connection_close); - -KMS_MSG_EXPORT (void) -kms_request_opt_set_crypto_hooks (kms_request_opt_t *opt, - bool (*sha256) (void *ctx, - const char *input, - size_t len, - unsigned char *hash_out), - bool (*sha256_hmac) (void *ctx, - const char *key_input, - size_t key_len, - const char *input, - size_t len, - unsigned char *hash_out), - void *ctx); - -KMS_MSG_EXPORT (void) -kms_request_opt_set_crypto_hook_sign_rsaes_pkcs1_v1_5 ( - kms_request_opt_t *opt, - bool (*sign_rsaes_pkcs1_v1_5) (void *ctx, - const char *private_key, - size_t private_key_len, - const char *input, - size_t input_len, - unsigned char *signature_out), - void *ctx); -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* KMS_REQUEST_OPT_H */ diff --git a/src/third_party/kms-message/src/kms_message/kms_response.h b/src/third_party/kms-message/src/kms_message/kms_response.h deleted file mode 100644 index d270f248826..00000000000 --- a/src/third_party/kms-message/src/kms_message/kms_response.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2018-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef KMS_RESPONSE_H -#define KMS_RESPONSE_H - -#include "kms_message_defines.h" - -#include <sys/types.h> - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct _kms_response_t kms_response_t; - -KMS_MSG_EXPORT (int) -kms_response_get_status (kms_response_t *response); -KMS_MSG_EXPORT (const char *) -kms_response_get_body (kms_response_t *response, size_t *len); -KMS_MSG_EXPORT (void) kms_response_destroy (kms_response_t *response); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* KMS_RESPONSE_H */ diff --git a/src/third_party/kms-message/src/kms_message/kms_response_parser.h b/src/third_party/kms-message/src/kms_message/kms_response_parser.h deleted file mode 100644 index 0bdf0809a00..00000000000 --- a/src/third_party/kms-message/src/kms_message/kms_response_parser.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2018-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef KMS_RESPONSE_PARSER_H -#define KMS_RESPONSE_PARSER_H - -#include "kms_message_defines.h" -#include "kms_response.h" - -#include <sys/types.h> -#include <stdbool.h> -#include <stdint.h> - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct _kms_response_parser_t kms_response_parser_t; - -KMS_MSG_EXPORT (kms_response_parser_t *) -kms_response_parser_new (void); - -KMS_MSG_EXPORT (int) -kms_response_parser_wants_bytes (kms_response_parser_t *parser, int32_t max); - -KMS_MSG_EXPORT (bool) -kms_response_parser_feed (kms_response_parser_t *parser, - uint8_t *buf, - uint32_t len); - -KMS_MSG_EXPORT (kms_response_t *) -kms_response_parser_get_response (kms_response_parser_t *parser); - -KMS_MSG_EXPORT (int) -kms_response_parser_status (kms_response_parser_t *parser); - -KMS_MSG_EXPORT (const char *) -kms_response_parser_error (kms_response_parser_t *parser); - -KMS_MSG_EXPORT (void) -kms_response_parser_destroy (kms_response_parser_t *parser); - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* KMS_RESPONSE_PARSER_H */ |