Skip to content

Commit

Permalink
Merge branch 'master' into 'master'
Browse files Browse the repository at this point in the history
résolution du nom du certificat public du borker

See merge request ingescape/ingescape-library!48
  • Loading branch information
ingenuityio committed May 4, 2021
2 parents d053f36 + 637b040 commit 61a8ac1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/igs_network.c
Original file line number Diff line number Diff line change
Expand Up @@ -3246,17 +3246,19 @@ void igs_brokersClear(void){
zhash_autofree(coreContext->brokers);
}

igs_result_t igs_brokerAddSecure(const char *brokerEndpoint, const char *publicCertificatesDirectory){
igs_result_t igs_brokerAddSecure(const char *brokerEndpoint, const char *pathToPublicCertificateForBroker){
core_initContext();
assert(brokerEndpoint);
assert(publicCertificatesDirectory);
if (!zsys_file_exists(publicCertificatesDirectory)){
igs_error("'%s' does not exist for %s", publicCertificatesDirectory, brokerEndpoint);
assert(pathToPublicCertificateForBroker);
char publicKeyPath[IGS_MAX_PATH_LENGTH] = "";
admin_makeFilePath(pathToPublicCertificateForBroker, publicKeyPath, IGS_MAX_PATH_LENGTH);
if (!zsys_file_exists(publicKeyPath)){
igs_error("'%s' does not exist for %s", publicKeyPath, brokerEndpoint);
return IGS_FAILURE;
}
assert(coreContext->brokers);
char *endPt = strdup(brokerEndpoint);
char *certDir = strndup(publicCertificatesDirectory, IGS_MAX_PATH_LENGTH);
char *certDir = strndup(publicKeyPath, IGS_MAX_PATH_LENGTH);
if (zhash_insert(coreContext->brokers, endPt, certDir) != IGS_SUCCESS){
igs_error("could not add '%s' (certainly because it is already added)", brokerEndpoint);
free(endPt);
Expand Down

0 comments on commit 61a8ac1

Please sign in to comment.