Skip to content

Commit e950455

Browse files
committed
Fix provision segfault if integrity-signing-private-key is not configured
1 parent 550b9d1 commit e950455

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/provisioner/provisioner.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,12 +1097,14 @@ static int respond_collector_auth(provision_state_t *state,
10971097
return -1;
10981098
}
10991099

1100-
if (push_ics_signing_key_onto_net_buffer(outgoing,
1101-
state->integrity_sign_private_key) == -1) {
1102-
logger(LOG_INFO,
1103-
"OpenLI provisioner: unable to send ICS private key to new collector on fd %s", pev->fd);
1104-
pthread_mutex_unlock(&(state->interceptconf.safelock));
1105-
return -1;
1100+
if (state->integrity_sign_private_key) {
1101+
if (push_ics_signing_key_onto_net_buffer(outgoing,
1102+
state->integrity_sign_private_key) == -1) {
1103+
logger(LOG_INFO,
1104+
"OpenLI provisioner: unable to send ICS private key to new collector on fd %s", pev->fd);
1105+
pthread_mutex_unlock(&(state->interceptconf.safelock));
1106+
return -1;
1107+
}
11061108
}
11071109

11081110
if (push_all_agency_digest_configs(state->interceptconf.leas,

0 commit comments

Comments
 (0)