diff options
| author | William Casarin <jb55@jb55.com> | 2020-11-07 10:57:36 -0800 |
|---|---|---|
| committer | Drew DeVault <sir@cmpwn.com> | 2020-11-08 09:38:04 -0500 |
| commit | ea40fb5a534d6e78d403140307b48f966e3d0719 (patch) | |
| tree | 0e545df0348546fdea3af7bc6dcea0781c779527 /include | |
| parent | 7aedbed7740c3ee5d60705a2ad74cdc760e60f2e (diff) | |
| download | gmnisrv-ea40fb5a534d6e78d403140307b48f966e3d0719.tar.gz gmnisrv-ea40fb5a534d6e78d403140307b48f966e3d0719.tar.xz gmnisrv-ea40fb5a534d6e78d403140307b48f966e3d0719.zip | |
tls: fix crash when opening priv key for writing
The open syscall will return a negative value if the call fails. Switch
the check to look for this instead of 0.
before:
[gmnisrv] generating certificate for localhost
gmnisrv: src/tls.c:68: tls_host_gencert: Assertion `pf' failed.
abort (core dumped) ./gmnisrv -C config.ini
after:
[gmnisrv] generating certificate for localhost
[gmnisrv] opening private key for writing failed: No such file or directory
[gmnisrv] TLS initialization failed
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
