|
@@ -85,6 +85,8 @@ UA_Client_secure_init(UA_Client* client, UA_ClientConfig config,
|
|
return STATUS_CODE_BAD_POINTER;
|
|
return STATUS_CODE_BAD_POINTER;
|
|
|
|
|
|
memset(client, 0, sizeof(UA_Client));
|
|
memset(client, 0, sizeof(UA_Client));
|
|
|
|
+ client->config = config;
|
|
|
|
+
|
|
/* Allocate memory for certificate verification */
|
|
/* Allocate memory for certificate verification */
|
|
client->securityPolicy.certificateVerification =
|
|
client->securityPolicy.certificateVerification =
|
|
(UA_CertificateVerification *)
|
|
(UA_CertificateVerification *)
|
|
@@ -96,7 +98,7 @@ UA_Client_secure_init(UA_Client* client, UA_ClientConfig config,
|
|
revocationList, revocationListSize);
|
|
revocationList, revocationListSize);
|
|
|
|
|
|
if(retval != UA_STATUSCODE_GOOD) {
|
|
if(retval != UA_STATUSCODE_GOOD) {
|
|
- UA_LOG_ERROR(client->channel.securityPolicy->logger, UA_LOGCATEGORY_SECURECHANNEL,
|
|
|
|
|
|
+ UA_LOG_ERROR(&client->config.logger, UA_LOGCATEGORY_SECURECHANNEL,
|
|
"Trust list parsing failed with error %s", UA_StatusCode_name(retval));
|
|
"Trust list parsing failed with error %s", UA_StatusCode_name(retval));
|
|
return retval;
|
|
return retval;
|
|
}
|
|
}
|
|
@@ -104,14 +106,13 @@ UA_Client_secure_init(UA_Client* client, UA_ClientConfig config,
|
|
/* Initiate client security policy */
|
|
/* Initiate client security policy */
|
|
retval = (*securityPolicyFunction)(&client->securityPolicy,
|
|
retval = (*securityPolicyFunction)(&client->securityPolicy,
|
|
client->securityPolicy.certificateVerification,
|
|
client->securityPolicy.certificateVerification,
|
|
- certificate, privateKey, &config.logger);
|
|
|
|
|
|
+ certificate, privateKey, &client->config.logger);
|
|
if(retval != UA_STATUSCODE_GOOD) {
|
|
if(retval != UA_STATUSCODE_GOOD) {
|
|
UA_LOG_ERROR(client->channel.securityPolicy->logger, UA_LOGCATEGORY_CLIENT,
|
|
UA_LOG_ERROR(client->channel.securityPolicy->logger, UA_LOGCATEGORY_CLIENT,
|
|
"Failed to setup the SecurityPolicy with error %s", UA_StatusCode_name(retval));
|
|
"Failed to setup the SecurityPolicy with error %s", UA_StatusCode_name(retval));
|
|
return retval;
|
|
return retval;
|
|
}
|
|
}
|
|
|
|
|
|
- client->config = config;
|
|
|
|
if(client->config.stateCallback)
|
|
if(client->config.stateCallback)
|
|
client->config.stateCallback(client, client->state);
|
|
client->config.stateCallback(client, client->state);
|
|
|
|
|