OpenKMIP / PyKMIP

A Python implementation of the KMIP specification.
Apache License 2.0
272 stars 134 forks source link

RequestLengthMismatch: KMIPProtocol read error #718

Open anilsahu323 opened 6 months ago

anilsahu323 commented 6 months ago

/tmp/pykmip.conf looks like: [client] host= Key Management Server IP port=5696 username= ---> The ID is created already in Thales CipherTrust Manager password= keyfile=/tmp/key.pem
certfile=/tmp/cert.pem ca_certs=/tmp/ca.pem

Note: All the pem files i have created in Thales Cipher Trust Manager and copied here to client side from which i am trying to execute my client edb_tde_kmip_client.py .

Created a new key in Tales Cipher Trust manager and the keyID i am using here:

printf secret | python3 /usr/edb/kmip/client/edb_tde_kmip_client.py encrypt --out-file=test.bin --pykmip-config-file=/tmp/pykmip.conf --key-uid='08db8b66a8044f3da2359fa4b1e0729d9f7ee3508ebc4dd2b3bbd620472485ec' --variant=thales

Since the above command failed i tried to create a new key using the following way: from kmip.pie import client

from kmip import enums c = client.ProxyKmipClient(config_file='/tmp/pykmip.conf') c.open() key_id = c.create(enums.CryptographicAlgorithm.AES, 128, name='edbtestkey')

Both the command failed with the following Error:

Traceback (most recent call last): File “/home/era/.local/lib/python3.6/site-packages/kmip/services/kmip_protocol.py”, line 44, in read header = self._recv_all(self.HEADER_SIZE) File “/home/era/.local/lib/python3.6/site-packages/kmip/services/kmip_protocol.py”, line 70, in _recv_all raise RequestLengthMismatch(total_bytes_to_be_read, bytes_read) kmip.services.kmip_protocol.RequestLengthMismatch: KMIPProtocol read error: expected 8, received 0

Python version is : 3.6.8

May i know what could be the issue here?