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

Skip to content

Conversation

@jpocas
Copy link

@jpocas jpocas commented Mar 19, 2025

Fixed some linked list and alloc issues with the previous checkin

jpocas and others added 12 commits November 20, 2024 11:39
In the Makefile, LIB_DIR was not consistently used, and instead "lib"
was specified. This broke any attempt to redirect installation, such as
when RPM packaging with rpmbuild, and was not the correct dir for
systems that use "lib64" such as most RHEL (and downstream) amd64 arch
systems.
Fix inconsistent use of LIB_DIR in Makefile
In kmip_bio_create_symmetric_key_with_context as used in demo_query.c,
this function allocates some of the linked list storage on the stack but
then tries to free it up later. So change this to heap allocate using
the KMIP ctx's alloc function.
Fix SIGSEGV in query mid level api
* initial support for Get Attributes with KMIP <= 1.4
* in KMIP 2.0, the Get Attributes payload was changed from a variable
  number of Attribute structures to an Attributes (note the plural)
  structure making this patch not forward compaitble. So if the KMIP
  version of the requestor doesn't match, it will go down the v2 path
  which doesn't have a lot of support.
* along the lines of the prevous comment, there's a lot of code between
  decode_attribute_v1 and decode_attribute_v2 that could probably be
  shared and is compatible, so it's left up to a future task to clean
  that up with a good refactoring
* when performing a kmip_decode_attribute_v1 we may encounter a
  yet-unknown attribute, including custom attributes. For the purpose of
  not bailing out, we can just decode the name as a new enum value
  KMIP_ATTR_UNKNOWN and just skipping past the length in the generic
  Attribute structure
* added Original Creation Date and Last Change Date datetime attributes
  after testing with Fortanix DSM
Remove redundant _LINK in KMIP_LINK_REPLACED_OBJECT_LINK, making it just
KMIP_LINK_REPLACED_OBJECT. This matches the convention of the others.
- misuse of printf wrote to stdout instead of the user supplied FILE*
Only the attributes part of the LocateRequestPayload are dynamic.

TODO: add handling of OOM for attributes here. None exist atm.
Fixed some linked list and alloc issues with the previous checkin
@jpocas jpocas closed this Mar 19, 2025
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.

2 participants