Skip to content

Commit

Permalink
Fix eap tls preload certificate chains for realms
Browse files Browse the repository at this point in the history
  • Loading branch information
mihmantis committed Mar 1, 2024
1 parent bb488d0 commit b49d88c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -4771,7 +4771,7 @@ static int tls_realms_load(fr_tls_server_conf_t *conf)
S_ISDIR(stat_buf.st_mode)) continue;

strcpy(buffer2, buffer);
p = strchr(buffer2, '.'); /* which must be there... */
p = strrchr(buffer2, '.'); /* which must be there... */
if (!p) continue;

/*
Expand All @@ -4780,7 +4780,7 @@ static int tls_realms_load(fr_tls_server_conf_t *conf)
* the chain file.
*/
strcpy(p, ".key");
if (stat(buffer2, &stat_buf) != 0) private_key_file = buffer2;
if (stat(buffer2, &stat_buf) == 0) private_key_file = buffer2;

ctx = tls_init_ctx(conf, 1, buffer, private_key_file);
if (!ctx) goto error;
Expand Down

0 comments on commit b49d88c

Please sign in to comment.