int aws_kms_decrypt_blocking_from_request()

in source/kms.c [2718:2740]


int aws_kms_decrypt_blocking_from_request(
    struct aws_nitro_enclaves_kms_client *client,
    const struct aws_kms_decrypt_request *request_structure,
    struct aws_byte_buf *plaintext) {
    AWS_PRECONDITION(client != NULL);
    AWS_PRECONDITION(request_structure != NULL);
    AWS_PRECONDITION(plaintext != NULL);

    struct aws_kms_decrypt_response *response_structure = NULL;
    int rc = AWS_OP_ERR;

    response_structure = s_kms_get_decrypt_response_from_request(client, request_structure);
    if (response_structure == NULL) {
        fprintf(stderr, "Could not read response from KMS\n");
    } else {
        rc = s_decrypt_ciphertext_for_recipient(
            client->allocator, &response_structure->ciphertext_for_recipient, client->keypair, plaintext);
    }

    aws_kms_decrypt_response_destroy(response_structure);

    return rc;
}