Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rjew3ll
Copy link
Contributor

@rjew3ll rjew3ll commented Jan 24, 2021

Add Query operation and demo program.
Add ssl_connect functions.

This is just the query operation. Still need to look at the tests.

Add Query operation and demo program.
Add ssl_connect functions.
Copy link
Contributor

@PeterHamilton PeterHamilton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I like most of the Query changes. I'll need to do a second pass to verify the correctness on most of the new functionality. Unit tests must be added for most of the new functions and existing unit tests should be modified for the existing functions that were modified.

I am less sure if we want to use the SSL modifications. The demo applications are just that, demonstrations of how to use the library. If a developer wants to augment or improve how SSL is handled, then they can incorporate that into their own applications.


#define MAX_QUERY_LEN 128
#define MAX_QUERY_OPS 0x40
#define MAX_QUERY_OBJS 0x20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move these #define statements over with the others.

char build_level[MAX_QUERY_LEN];
char build_date[MAX_QUERY_LEN];
char cluster_info[MAX_QUERY_LEN];
} QueryResponse;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fields in this struct don' correspond to the fields defined in the specification. Defining maximum array lengths also doesn't align with the repeating nature of some of these fields. Most of them should be linked lists that grow as needed to fit the encoding or user usage.

Don't use ssl_connect wrapper yet.
Copy link
Contributor

@PeterHamilton PeterHamilton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating this pull request. While I would prefer the not implemented functions to be filled in, the surrounding additions are definitely worthwhile and I would like to see them added to the library.

That said, at a minimum the new encoding/decoding/compare functions must have unit tests associated with them. See here for an example of how the Create request payload encoding is tested.

I will not be able to merge this in until unit tests are added for:

  • kmip_compare_query_functions
  • kmip_encode_query_functions
  • kmip_encode_query_request_payload
  • kmip_decode_query_functions
  • kmip_decode_operations
  • kmip_decode_object_types
  • kmip_decode_server_information
  • kmip_decode_query_response_payload

Please also address the remaining comments on the kmip.h modifications. Thanks!

@rjew3ll
Copy link
Contributor Author

rjew3ll commented Mar 2, 2021

I should be able to work on this again soon.

User Functions structure instead of LinkedList or QueryRequestPayload.
Add decode/compare functions for more query functions.
Add some decode/encode tests.
@rjew3ll
Copy link
Contributor Author

rjew3ll commented Apr 14, 2021

I'm still working on this. This is an intermediate drop with 4 tests added.

@srgg
Copy link

srgg commented Apr 23, 2021

With all the respect to the efforts, any chance to get this done?

@PeterHamilton
Copy link
Contributor

PeterHamilton commented Apr 23, 2021

@rjew3ll Thanks again for posting an update to this patch. I'm swamped with other things right now but I am hoping to spend some time on this within the next week.

@srgg Yes, I'm hoping to get this reviewed and merged in soon. My apologies for the delay!

rjew3ll added 2 commits April 24, 2021 10:02
Add tests for querying server information and object types.
Add test for decode_query_response_payload
@rjew3ll
Copy link
Contributor Author

rjew3ll commented Apr 24, 2021

I think I've added the requested tests.
The only thing I still need to do up update the way the data is returned to the caller. The structure I used was intended to be simple and not require any memory management, but I agree it cannot handle all the fields added since KMIP 1.3. (I just wanted the vendor name and build info). If the data structure needs to be dynamic, the caller is going to have to help configure/allocate/free the memory needed.

Copy link
Contributor

@PeterHamilton PeterHamilton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for submitting the additional tests. This looks pretty well rounded and adds a lot of useful functionality.

Just address that one question on that final test case comparing query functions and this will be good to go.

@PeterHamilton PeterHamilton merged commit 98eb961 into OpenKMIP:master May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants