diff --git a/libnvme/src/nvme/fabrics.c b/libnvme/src/nvme/fabrics.c index 3ca0f22518..e480976d33 100644 --- a/libnvme/src/nvme/fabrics.c +++ b/libnvme/src/nvme/fabrics.c @@ -732,6 +732,21 @@ static int build_options(nvme_host_t h, nvme_ctrl_t c, char **argstr) ctrlkey = nvme_ctrl_get_dhchap_key(c); + if (cfg->tls && cfg->concat) { + nvme_msg(h->ctx, LOG_ERR, "cannot specify --tls and --concat together\n"); + return -ENVME_CONNECT_INVAL; + } + + if (cfg->concat && !hostkey) { + nvme_msg(h->ctx, LOG_ERR, "required argument [--dhchap-secret | -S] not specified with --concat\n"); + return -ENVME_CONNECT_INVAL; + } + + if (cfg->concat && ctrlkey) { + nvme_msg(h->ctx, LOG_ERR, "cannot specify [--dhchap-ctrl-secret | -C] with --concat\n"); + return -ENVME_CONNECT_INVAL; + } + if (cfg->tls) { ret = __nvme_import_keys_from_config(h, c, &keyring_id, &key_id); if (ret)