kmip 1.4 server -> pykmip client error with server_correlation_value in header
Hello!
I have some issue with kmip client (ProxyKmipClient/PyKMIP 0.10.0), when requesting symmetric key from KMIP server using kmip version 1.4 server response contains server_correlation_value which is a "Not Required" Response Header field in KMIP spec starting from 1.4:
RESPONSE_MESSAGE:STRUCTURE(240):stru1
RESPONSE_HEADER:STRUCTURE(120):stru2
PROTOCOL_VERSION:STRUCTURE(32):stru3
PROTOCOL_VERSION_MAJOR:INTEGER(4):1
PROTOCOL_VERSION_MINOR:INTEGER(4):4
TIME_STAMP:DATE_TIME(8):
the ProxyKmipClient fails with error: kmip.core.exceptions.ReadValueError: Tried to read Base.tag: expected 0x42000d, received 0x420106 (trying to read batch count, but getting server_correlation_value)
I did some fix kmip/core/messages/messages.py, line 210 added this: if self.is_tag_next(enums.Tags.SERVER_CORRELATION_VALUE, tstream): server_correletion_value = primitives.TextString(tag=enums.Tags.SERVER_CORRELATION_VALUE) server_correletion_value.read(tstream, kmip_version=kmip_version) in ResponseHeader.read
which fixed the problem. Are these fields not supported in current version of a client? Thank you!
No, the server_correlation_value is not currently supported, but it would be good to fix that error when it (or any of the other optional fields) is present.
I think you found the right place to fix it in ResponseHeader.read().
Response Header reference: https://docs.oasis-open.org/kmip/kmip-spec/v2.0/os/kmip-spec-v2.0-os.html#_Toc6497625