mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-02-17 07:11:21 +01:00
BUG/MINOR: ssl: close ssl key file on error
Explicitly close the FILE opened to read the ssl key file when parsing fails to find a valid key. This fix needs to be backported to 1.6.
This commit is contained in:
parent
a58c4359bb
commit
16aa0153b5
@ -5401,6 +5401,7 @@ static int bind_parse_tls_ticket_keys(char **args, int cur_arg, struct proxy *px
|
||||
if (base64dec(thisline, len, (char *) (keys_ref->tlskeys + i % TLS_TICKETS_NO), sizeof(struct tls_sess_key)) != sizeof(struct tls_sess_key)) {
|
||||
if (err)
|
||||
memprintf(err, "'%s' : unable to decode base64 key on line %d", args[cur_arg+1], i + 1);
|
||||
fclose(f);
|
||||
return ERR_ALERT | ERR_FATAL;
|
||||
}
|
||||
i++;
|
||||
@ -5409,6 +5410,7 @@ static int bind_parse_tls_ticket_keys(char **args, int cur_arg, struct proxy *px
|
||||
if (i < TLS_TICKETS_NO) {
|
||||
if (err)
|
||||
memprintf(err, "'%s' : please supply at least %d keys in the tls-tickets-file", args[cur_arg+1], TLS_TICKETS_NO);
|
||||
fclose(f);
|
||||
return ERR_ALERT | ERR_FATAL;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user