]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: ssl/cli: 'commit ssl cert' crashes when no private key
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 24 Jun 2020 14:26:41 +0000 (16:26 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 24 Jun 2020 14:52:22 +0000 (16:52 +0200)
commita941952ae1dbae0b7d015ad29dcf877d1f74df0b
treead9dbbdc877cfffb34abeae71a5c59fe2d0bbd1c
parente7723bddd7c39ae54531f9dd405a6e059e561d65
BUG/MEDIUM: ssl/cli: 'commit ssl cert' crashes when no private key

A crash was reported in issue #707 because the private key was not
uploaded correctly with "set ssl cert".

The bug is provoked by X509_check_private_key() being called when there
is no private key, which can lead to a segfault.

This patch adds a check and return an error is the private key is not
present.

This must be backported in 2.1.
src/ssl_ckch.c