TNC_Version *actual_version)
{
private_imv_os_agent_t *this;
+ imv_agent_t *agent;
+
+ agent = imv_agent_create(name, msg_types, countof(msg_types), id,
+ actual_version);
+ if (!agent)
+ {
+ return NULL;
+ }
INIT(this,
.public = {
.solicit_recommendation = _solicit_recommendation,
.destroy = _destroy,
},
- .agent = imv_agent_create(name, msg_types, countof(msg_types), id,
- actual_version),
+ .agent = agent,
.db = imv_os_database_create(imcv_db),
);
- if (!this->agent)
- {
- destroy(this);
- return NULL;
- }
return &this->public;
}
TNC_Version *actual_version)
{
private_imv_test_agent_t *this;
+ imv_agent_t *agent;
+
+ agent = imv_agent_create(name, msg_types, countof(msg_types), id,
+ actual_version);
+ if (!agent)
+ {
+ return NULL;
+ }
INIT(this,
.public = {
.solicit_recommendation = _solicit_recommendation,
.destroy = _destroy,
},
- .agent = imv_agent_create(name, msg_types, countof(msg_types), id,
- actual_version),
+ .agent = agent,
);
- if (!this->agent)
- {
- destroy(this);
- return NULL;
- }
return &this->public;
}
DBG1(DBG_IMC, "IMC \"%s\" has already been initialized", imc_name);
return TNC_RESULT_ALREADY_INITIALIZED;
}
- if (!pts_meas_algo_probe(&supported_algorithms) ||
- !pts_dh_group_probe(&supported_dh_groups))
- {
- return TNC_RESULT_FATAL;
- }
imc_attestation = imc_agent_create(imc_name, msg_types, countof(msg_types),
imc_id, actual_version);
if (!imc_attestation)
return TNC_RESULT_FATAL;
}
+ if (!pts_meas_algo_probe(&supported_algorithms) ||
+ !pts_dh_group_probe(&supported_dh_groups))
+ {
+ imc_attestation->destroy(imc_attestation);
+ imc_attestation = NULL;
+ return TNC_RESULT_FATAL;
+ }
libpts_init();
if (min_version > TNC_IFIMC_VERSION_1 || max_version < TNC_IFIMC_VERSION_1)
TNC_Version *actual_version)
{
private_imv_attestation_agent_t *this;
+ imv_agent_t *agent;
char *hash_alg, *dh_group, *cadir;
+ agent = imv_agent_create(name, msg_types, countof(msg_types), id,
+ actual_version);
+ if (!agent)
+ {
+ return NULL;
+ }
+
hash_alg = lib->settings->get_str(lib->settings,
"libimcv.plugins.imv-attestation.hash_algorithm", "sha256");
dh_group = lib->settings->get_str(lib->settings,
.solicit_recommendation = _solicit_recommendation,
.destroy = _destroy,
},
- .agent = imv_agent_create(name, msg_types, countof(msg_types), id,
- actual_version),
+ .agent = agent,
.supported_algorithms = PTS_MEAS_ALGO_NONE,
.supported_dh_groups = PTS_DH_GROUP_NONE,
.pts_credmgr = credential_manager_create(),
libpts_init();
- if (!this->agent ||
- !pts_meas_algo_probe(&this->supported_algorithms) ||
+ if (!pts_meas_algo_probe(&this->supported_algorithms) ||
!pts_dh_group_probe(&this->supported_dh_groups) ||
!pts_meas_algo_update(hash_alg, &this->supported_algorithms) ||
!pts_dh_group_update(dh_group, &this->supported_dh_groups))
return &this->public;
}
-