-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
Not Needed
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Background & Motivation
kms_response_t represents a generic KMS message response, which may be from AWS, Azure, GCP, or KMIP. Not all fields in the kms_response_t struct apply to all KMS providers. A clearer separation of fields by KMS provider may help clarify and help with maintainability.
Scope
Separate KMS provider specific fields in kms_response_t and clarify which fields apply to which KMS provider. Here is a proposed solution with a union:
struct _kms_response_t {
char error[512];
bool failed;
kms_request_provider_t provider;
union {
struct {
int status;
kms_kv_list_t *headers;
kms_request_str_t *body;
} aws;
struct {
int status;
kms_kv_list_t *headers;
kms_request_str_t *body;
} gcp;
struct {
int status;
kms_kv_list_t *headers;
kms_request_str_t *body;
} azure;
struct {
uint8_t *data;
uint32_t len;
} kmip;
}