+
+/*
+ * TODO
+ * This API is required to move from old external key API to new generic one
+ * (see keys.h). The old API could be then removed. Next step could be to pass
+ * the device as argument to all functions as LUKS API does. If that happens
+ * this function will become unnecessary.
+ */
+int ode_external_encryption_get_device_path(char** device)
+{
+ RET_ON_FAILURE(device, ODE_ERROR_INVALID_PARAMETER);
+
+ ClientContext client;
+ RET_ON_FAILURE(client.connect() == 0, ODE_ERROR_CONNECTION_REFUSED);
+ ExternalEncryptionClient external = client.createInterface<ExternalEncryptionClient>();
+ std::string path = external.getDevicePath();
+ if (path.empty())
+ return ODE_ERROR_UNKNOWN;
+
+ *device = strdup(path.c_str());
+ return ODE_ERROR_NONE;
+}