diff options
| author | deraadt <> | 2019-01-26 11:30:32 +0000 | 
|---|---|---|
| committer | deraadt <> | 2019-01-26 11:30:32 +0000 | 
| commit | 22c5663efc9813a7ec74f1d59c835b34aceb6062 (patch) | |
| tree | ddf1007f5651a79307c50ef4c4eec9691ef78723 /src | |
| parent | d44f02f61b6eec3b01f5d23d36bb9836f16b87ba (diff) | |
| download | openbsd-22c5663efc9813a7ec74f1d59c835b34aceb6062.tar.gz openbsd-22c5663efc9813a7ec74f1d59c835b34aceb6062.tar.bz2 openbsd-22c5663efc9813a7ec74f1d59c835b34aceb6062.zip | |
Recent discussions about abort() potentially leaving key material in
core files (which can depend upon various file layouts) have resonated
with my hate for this function outside a purely debugging context.  I
also dislike how the report goes to stderr which may get lost or ignored.
Increase the noise (with syslog_r) and use _exit(1) to gaurantee termination.
ok jsing
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/cryptlib.c | 13 | 
1 files changed, 8 insertions, 5 deletions
| diff --git a/src/lib/libcrypto/cryptlib.c b/src/lib/libcrypto/cryptlib.c index 5518c66c46..38d31e7ac2 100644 --- a/src/lib/libcrypto/cryptlib.c +++ b/src/lib/libcrypto/cryptlib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: cryptlib.c,v 1.44 2018/11/24 04:11:47 jsing Exp $ */ | 1 | /* $OpenBSD: cryptlib.c,v 1.45 2019/01/26 11:30:32 deraadt Exp $ */ | 
| 2 | /* ==================================================================== | 2 | /* ==================================================================== | 
| 3 | * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. | 
| 4 | * | 4 | * | 
| @@ -118,6 +118,8 @@ | |||
| 118 | #include <stdarg.h> | 118 | #include <stdarg.h> | 
| 119 | #include <stdio.h> | 119 | #include <stdio.h> | 
| 120 | #include <string.h> | 120 | #include <string.h> | 
| 121 | #include <syslog.h> | ||
| 122 | #include <unistd.h> | ||
| 121 | 123 | ||
| 122 | #include <openssl/opensslconf.h> | 124 | #include <openssl/opensslconf.h> | 
| 123 | #include <openssl/crypto.h> | 125 | #include <openssl/crypto.h> | 
| @@ -343,10 +345,11 @@ OPENSSL_cpuid_setup(void) | |||
| 343 | static void | 345 | static void | 
| 344 | OPENSSL_showfatal(const char *fmta, ...) | 346 | OPENSSL_showfatal(const char *fmta, ...) | 
| 345 | { | 347 | { | 
| 348 | struct syslog_data sdata = SYSLOG_DATA_INIT; | ||
| 346 | va_list ap; | 349 | va_list ap; | 
| 347 | 350 | ||
| 348 | va_start(ap, fmta); | 351 | va_start(ap, fmta); | 
| 349 | vfprintf(stderr, fmta, ap); | 352 | vsyslog_r(LOG_INFO|LOG_LOCAL2, &sdata, fmta, ap); | 
| 350 | va_end(ap); | 353 | va_end(ap); | 
| 351 | } | 354 | } | 
| 352 | 355 | ||
| @@ -354,9 +357,9 @@ void | |||
| 354 | OpenSSLDie(const char *file, int line, const char *assertion) | 357 | OpenSSLDie(const char *file, int line, const char *assertion) | 
| 355 | { | 358 | { | 
| 356 | OPENSSL_showfatal( | 359 | OPENSSL_showfatal( | 
| 357 | "%s(%d): OpenSSL internal error, assertion failed: %s\n", | 360 | "uid %u cmd %s %s(%d): OpenSSL internal error, assertion failed: %s\n", | 
| 358 | file, line, assertion); | 361 | getuid(), getprogname(), file, line, assertion); | 
| 359 | abort(); | 362 | _exit(1); | 
| 360 | } | 363 | } | 
| 361 | 364 | ||
| 362 | int | 365 | int | 
