diff --git a/op_locate.go b/op_locate.go index 74c91e7..4398525 100644 --- a/op_locate.go +++ b/op_locate.go @@ -19,8 +19,8 @@ type LocateRequestPayload struct { // Table 191 type LocateResponsePayload struct { - LocatedItems uint32 // Required: No - UniqueIdentifier string // Required: No + LocatedItems uint32 // Required: No + UniqueIdentifier []string // Required: No } type LocateHandler struct { diff --git a/src/kmipapi/kmip14.go b/src/kmipapi/kmip14.go index 524c7e9..5ef1a7c 100755 --- a/src/kmipapi/kmip14.go +++ b/src/kmipapi/kmip14.go @@ -301,9 +301,16 @@ func (kmips *kmip14service) Locate(ctx context.Context, settings *ConfigurationS return nil, fmt.Errorf("unable to decode GetResponsePayload, error: %v", err) } - uid := respPayload.UniqueIdentifier + logger.V(4).Info("XXX Locate response payload", "respPayload", respPayload) + + uids := respPayload.UniqueIdentifier logger.V(4).Info("XXX Locate response payload", "uid", respPayload.UniqueIdentifier) + uid := "" + if len(uids) > 0 { + uid = uids[0] + } + return &LocateResponse{UniqueIdentifier: uid}, nil } diff --git a/src/kmipapi/kmip20.go b/src/kmipapi/kmip20.go index 2aedd08..1f29abc 100755 --- a/src/kmipapi/kmip20.go +++ b/src/kmipapi/kmip20.go @@ -333,10 +333,15 @@ func (kmips *kmip20service) Locate(ctx context.Context, settings *ConfigurationS return nil, fmt.Errorf("unable to decode GetResponsePayload, error: %v", err) } - uid := respPayload.UniqueIdentifier + uids := respPayload.UniqueIdentifier logger.V(4).Info("XXX Locate response payload", "uid", respPayload.UniqueIdentifier) - return &LocateResponse{UniqueIdentifier: uid[0]}, nil + uid := "" + if len(uids) > 0 { + uid = uids[0] + } + + return &LocateResponse{UniqueIdentifier: uid}, nil } // SetAttribute: