Skip to content

Commit

Permalink
Fix pykmip client error with server_correlation_value issue
Browse files Browse the repository at this point in the history
  • Loading branch information
xlitao authored and arp102 committed Aug 1, 2023
1 parent 5f34bae commit f0a44b2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions kmip/core/messages/contents.py
Expand Up @@ -506,6 +506,13 @@ def __init__(self):
super(MessageExtension, self).__init__(enums.Tags.MESSAGE_EXTENSION)


# 6.19
class ServerCorrelationValue(TextString):
def __init__(self, value=None):
super(ServerCorrelationValue, self).__init__(
value, enums.Tags.SERVER_CORRELATION_VALUE)


# 9.1.3.2.2
class KeyCompressionType(Enumeration):

Expand Down
8 changes: 7 additions & 1 deletion kmip/core/messages/messages.py
Expand Up @@ -150,12 +150,14 @@ def __init__(self,
protocol_version=None,
time_stamp=None,
batch_count=None,
server_hashed_password=None):
server_hashed_password=None,
server_correlation_value=None):
super(ResponseHeader, self).__init__(tag=Tags.RESPONSE_HEADER)
self.protocol_version = protocol_version
self.time_stamp = time_stamp
self.batch_count = batch_count
self.server_hashed_password = server_hashed_password
self.server_correlation_value = server_correlation_value

self.validate()

Expand Down Expand Up @@ -204,6 +206,10 @@ def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
server_hashed_password.read(tstream, kmip_version=kmip_version)
self._server_hashed_password = server_hashed_password

if self.is_tag_next(enums.Tags.SERVER_CORRELATION_VALUE, tstream):
self.server_correlation_value = contents.ServerCorrelationValue()
self.server_correlation_value.read(tstream, kmip_version=kmip_version)

self.batch_count = contents.BatchCount()
self.batch_count.read(tstream, kmip_version=kmip_version)

Expand Down

0 comments on commit f0a44b2

Please sign in to comment.