Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
1be08a7
demo: fix fips-version Makefile so it loads the FIPS provider correctly
paulidale Jun 29, 2026
e9351bc
s390x: Fix AES-XTS hardware acceleration in IBM z17
ifranzki Jun 29, 2026
635ffe8
Fix use of BCryptGenRandom
mbroz Jun 29, 2026
8a57600
Use more recent default for _WIN32_WINNT
mbroz Jun 29, 2026
10c0927
Suppress MSVC C4996 in applink.c
idrassi Jun 29, 2026
2229aad
apps/s_server.c: fix SSL object leak on rpk_enable() failure
idrassi Jun 30, 2026
5d61a36
s_client: skip TCP shutdown drain for datagram protocols
mtrojnar Jun 27, 2026
8225d82
use evp_kem_free in evp_kem_from_algorithm
nhorman Jun 26, 2026
e4551d8
use evp_keyexch_free in evp_keyexch_from_algorithm
nhorman Jun 26, 2026
4c48ed7
use evp_keymgmt_free in keymgmt_from_algorithm
nhorman Jun 26, 2026
4d50403
use evp_signature_free in evp_signature_from_algorithm
nhorman Jun 26, 2026
8a072a3
use evp_asym_cipher_free in evp_asym_cipher_from_algorithm
nhorman Jun 26, 2026
7520345
quic: add mfail test for a read with key update
bukka Jun 22, 2026
b71c5cf
Add EVP_KDF_CTX_get0_kdf and EVP_KDF_CTX_get1_kdf, deprecate EVP_KDF_…
Leont Oct 19, 2025
a5b0c2e
test/evp_kdf_test.c: add checks or EVP_KDF_CTX_{,get0_,get1_}kdf()
esyr Jun 17, 2026
862844d
fuzz/provider.c: check evp##_up_ref return value in collect_##evp
esyr Jun 30, 2026
7c9b263
crypto/pem/pem_info.c: avoid switching on PEM_INFO_NONE
esyr Jun 30, 2026
a3b7e09
Add -n option to openssl-rand to not output the trailing newline
evysgarden Jun 30, 2026
8c8a80b
Extend refcounting on evp objects to provider requesed no-caching
nhorman Jun 29, 2026
a66d74c
add support to p_ossltest for non-cacheable fetches
nhorman Jun 30, 2026
cf82f5f
Add test to exercise non-caching code paths
nhorman Jun 30, 2026
ff6b868
ci: run full cross-compile tests on PRs with 'extended tests' label
bukka Jun 24, 2026
e59165a
crypto/x509: replace O(N^2) RFC 3779 canonicalisation merge with line…
provos May 12, 2026
a8db32e
apps: cover the CRL printing path in the pkcs7 test recipe
bukka Jun 23, 2026
4b873a1
x509: add delta CRL success test
bukka Jun 24, 2026
c30329c
apps: cover the req -set_serial option
bukka Jun 25, 2026
dd94348
apps: cover crl signature verification
bukka Jun 25, 2026
be16738
Remove internal-only DRBG_STATUS enum
fwh-dc Jun 30, 2026
3cd2f29
Removes two unused macros: MAX_RESEED_INTERVAL and MAX_RESEED_TIME_IN…
fwh-dc Jun 30, 2026
7e2879e
apps: test dsa app PVK output
bukka Jun 30, 2026
f908737
apps: cover x509 DER key/cert input formats
bukka Jun 25, 2026
70fa179
eliminate use of CRYPTO_GET_REF in sslapitest
nhorman Jun 25, 2026
16be827
Replace use of CRYPTO_GET_REF in bio_lib
nhorman Jun 26, 2026
562d2a1
Remove CRYPTO_GET_REF
nhorman Jun 26, 2026
c65777d
Add stack test for thunked sorted lookup
idrassi Apr 16, 2026
f31510e
quic: add mfail test for handshake multi-packet processing
bukka Jun 23, 2026
a894009
Fix new statem_clnt_test when dtls is disabled
nhorman Jul 3, 2026
64f09bd
crypto/x509/x509_lu.c: fix memory leak in obj_ht_foreach_object()
nikolapajkovsky Jun 30, 2026
46040a2
quic: do not hard fail mfail test for old fips providers
bukka Jul 6, 2026
a21fdfc
Fix crash in EVP_MD_CTX_copy_ex on inconsistent context
ifranzki Jul 6, 2026
b5b34d3
BIO: avoid returning internal FILE * with UPLINK-enabled builds on Wi…
olszomal Aug 5, 2025
d2a9af2
apps: adjust stat usage to account for uplink
olszomal Aug 8, 2025
8c7e3f2
apps/ocsp.c: guard index_changed() with OPENSSL_NO_POSIX_IO, not HTTP…
olszomal Jul 8, 2026
df5f836
Eliminate/fix repeated word usage
DimitriPapadopoulos Jul 4, 2026
518d66e
Remove parentheses around return arguments
DimitriPapadopoulos Jul 4, 2026
ae6de18
Eliminate repeated semicolons at the end of statements
DimitriPapadopoulos Jul 4, 2026
74e781d
Eliminate unnecessary type casts of int constants
DimitriPapadopoulos Jul 4, 2026
7812b20
Add parentheses around sizeof arguments
DimitriPapadopoulos Jul 4, 2026
cddeed0
Move const qualifier after static
DimitriPapadopoulos Jul 4, 2026
917ebfc
Eliminate unnecessary whitespace before a quoted newline
DimitriPapadopoulos Jul 4, 2026
5158437
doc/man3/ASN1_INTEGER_get_int64.pod: fix a typo
notroj Jul 1, 2026
1860496
Fix typos
DimitriPapadopoulos Jul 4, 2026
69cafbc
util/mkinstallvars.pl: Suppress more debug logs
orgads Jul 3, 2026
f167d0d
README.md: update web links to man pages
mbroz Jul 2, 2026
d9671f4
Remove unused source files poly1305_ieee754.c and poly1305_base2_44.c
fwh-dc Jun 25, 2026
f292439
BIO_vprintf: fix off-by-one at 512-byte buffer boundary
idrassi Jul 3, 2026
801d701
coveralls.yml: Disable the allocfail-tests
t8m Jul 7, 2026
76e33ae
property: replace property_memfail with in-tree mfail tests
bukka Jul 7, 2026
11889aa
Suppress function pointer type validation in clang ubsan
nhorman Jul 2, 2026
4e2e6f4
Allow `getentropy` for Emscripten
stevenwdv Jul 7, 2026
4d32206
test: add all-alias BIGNUM coverage in file_sum
urvalkheni Apr 18, 2026
4be956b
Fix remove_session_cb called while holding ctx->lock
mattcaswell Jun 16, 2026
b24c43f
Add regression test for remove_session_cb under lock
mattcaswell Jun 16, 2026
ea902d8
apps: cover the unencrypted key bag path in the pkcs12 test recipe
bukka Jun 23, 2026
0cb923d
Fix doubled semicolons as statement terminations
DimitriPapadopoulos Jul 7, 2026
a17cd76
[test] exercise AEAD tag read rejection when actually present during …
bbbrumley Jul 2, 2026
a4ee696
Reject AES-XTS operations without an IV
idrassi Jun 27, 2026
38c7ace
crypto/x509/x509_lu.c: check X509_OBJECT_up_ref_count() in x509_objec…
nikolapajkovsky Jun 30, 2026
6b6fc64
Add WRAP build.info variable
bukka Apr 10, 2026
bc79a23
Deprecate unit-test configure option and SSL_test_functions
bukka Apr 12, 2026
acd7679
Add unit testing cmocka based framework
bukka Jun 20, 2026
ac858ac
Add mkwraps script for generting wraps and expectations
bukka Apr 30, 2026
82ccc17
Add BIO bss_fd test
bukka Jun 12, 2026
bcbecdc
Add BIO bio_addr test
bukka May 14, 2026
90afdb1
Add BIO bss_conn test
bukka Jun 12, 2026
b69282a
Add BIO bss_acpt test
bukka Jun 12, 2026
b05333b
Add BIO bss_dgram test
bukka Jun 10, 2026
bd07dda
Add BIO bss_socket test
bukka Jun 10, 2026
207c40c
Add BIO bio_sock test
bukka Jun 12, 2026
234845a
Add BIO bio_sock2 test
bukka Jun 12, 2026
313567a
Don't raise NOT_ENOUGH_DATA on a clean EOF at an object boundary
icanhasmath Jul 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,14 @@ jobs:
run: git submodule update --init --depth 1 fuzz/corpora
- name: localegen
run: sudo locale-gen tr_TR.UTF-8
- name: cmocka
run: sudo apt-get -y install libcmocka-dev
- name: fipsvendor
# Make one fips build use a customized FIPS vendor
run: echo "FIPS_VENDOR=CI" >> VERSION.dat
- name: config
# enable-quic is on by default, but we leave it here to check we're testing the explicit enable somewhere
run: CC=gcc ./config --strict-warnings --banner=Configured enable-demos enable-h3demo enable-ec_explicit_curves enable-sslkeylog enable-fips enable-quic enable-lms && perl configdata.pm --dump
run: CC=gcc ./config --strict-warnings --banner=Configured enable-demos enable-h3demo enable-ec_explicit_curves enable-sslkeylog enable-fips enable-quic enable-lms enable-unit-tests && perl configdata.pm --dump
- name: make
run: make -s -j4
- name: get cpu info
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ jobs:
MATRIX=$(cat << EOF
[{
"branch": "master",
"extra_config": "enable-fips enable-tfo enable-lms enable-crypto-mdebug enable-allocfail-tests"
"extra_config": "enable-fips enable-tfo enable-lms enable-crypto-mdebug enable-unit-tests"
}, {
"branch": "openssl-4.0",
"extra_config": "enable-fips enable-tfo enable-lms enable-crypto-mdebug enable-allocfail-tests"
"extra_config": "enable-fips enable-tfo enable-lms enable-crypto-mdebug"
},{
"branch": "openssl-3.6",
"extra_config": "no-afalgeng enable-fips enable-tfo enable-lms"
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get -yq install lcov
sudo apt-get -yq install bison gettext keyutils ldap-utils libldap2-dev libkeyutils-dev python3 python3-paste python3-pyrad slapd tcsh python3-virtualenv virtualenv python3-kdcproxy
sudo apt-get -yq install bison gettext keyutils ldap-utils libcmocka-dev libldap2-dev libkeyutils-dev python3 python3-paste python3-pyrad slapd tcsh python3-virtualenv virtualenv python3-kdcproxy
- name: install Test2::V0 for gost_engine testing
uses: perl-actions/install-with-cpanm@10d60f00b4073f484fc29d45bfbe2f776397ab3d #v1.7
with:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/cross-compiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ permissions:

jobs:
cross-compilation:
# Run the full test suite on push, and on pull requests labelled with
# 'extended tests'. Other pull requests only run the EVP tests.
env:
EXTENDED: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'extended tests') }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -211,19 +215,19 @@ jobs:
cat /proc/cpuinfo
QEMU_LD_PREFIX=/usr/${{ matrix.platform.arch }} ./util/opensslwrap.sh version -c
- name: make all tests
if: github.event_name == 'push' && matrix.platform.tests == ''
if: env.EXTENDED == 'true' && matrix.platform.tests == ''
run: |
.github/workflows/make-test \
TESTS="-test_afalg" \
QEMU_LD_PREFIX=/usr/${{ matrix.platform.arch }}
- name: make some tests
if: github.event_name == 'push' && matrix.platform.tests != 'none' && matrix.platform.tests != ''
if: env.EXTENDED == 'true' && matrix.platform.tests != 'none' && matrix.platform.tests != ''
run: |
.github/workflows/make-test \
TESTS="${{ matrix.platform.tests }} -test_afalg" \
QEMU_LD_PREFIX=/usr/${{ matrix.platform.arch }}
- name: make evp tests
if: github.event_name == 'pull_request' && matrix.platform.tests != 'none'
if: env.EXTENDED != 'true' && matrix.platform.tests != 'none'
run: |
.github/workflows/make-test \
TESTS="test_evp*" \
Expand Down
19 changes: 17 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ OpenSSL Releases

### Changes between 4.0 and 4.1 [xx XXX xxxx]

* Added unit tests setup activated via `enable-unit-tests` option. This works
only on platforms with ld `--wrap` support (Linux, BSD).

*Jakub Zelenka*

* Deprecated the `enable-unit-test` configure option and the
`SSL_test_functions()` function. Both will be removed in OpenSSL 5.0.

*Jakub Zelenka*

* Added -testmode option for `s_time` app.

*Jakub Zelenka*
Expand Down Expand Up @@ -199,6 +209,11 @@ OpenSSL Releases

*Timo Keller*

* Added `EVP_KDF_CTX_get0_kdf()` and `EVP_KDF_CTX_get1_kdf()` functions
as a replacement for the now deprecated `EVP_KDF_CTX_kdf()`.

*Leon Timmermans*

* Add `FIPS_mode()` as a convenience define to
`EVP_default_properties_is_fips_enabled(NULL)`, which is
shorthand to check whether the `fips=yes` property is currently enabled
Expand Down Expand Up @@ -4098,7 +4113,7 @@ breaking changes, and mappings for the large list of deprecated functions.

* Fixed a bug in the function `OCSP_basic_verify` that verifies the signer
certificate on an OCSP response. The bug caused the function in the case
where the (non-default) flag OCSP_NOCHECKS is used to return a postivie
where the (non-default) flag OCSP_NOCHECKS is used to return a positive
response (meaning a successful verification) even in the case where the
response signing certificate fails to verify.

Expand Down Expand Up @@ -19896,7 +19911,7 @@ s-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
The new configuration file reading functions are:

NCONF_new, NCONF_free, NCONF_load, NCONF_load_fp, NCONF_load_bio,
NCONF_get_section, NCONF_get_string, NCONF_get_numbre
NCONF_get_section, NCONF_get_string, NCONF_get_number

NCONF_default, NCONF_WIN32

Expand Down
15 changes: 13 additions & 2 deletions Configurations/unix-Makefile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,8 @@ BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (),
'$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)

CMOCKA_LIBS={- $config{cmocka_libs} // '' -}

# CPPFLAGS_Q is used for one thing only: to build up buildinf.h
CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g;
$cppflags2 =~ s|([\\"])|\\$1|g;
Expand Down Expand Up @@ -2021,6 +2023,15 @@ EOF
push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
}
}
my $wrapflags = '';
my $cmocka = '';
if (defined $unified_info{wraps}->{$args{bin}}) {
$wrapflags = join(' ',
map { "-Wl,--wrap=$_" }
@{$unified_info{wraps}->{$args{bin}}});
$wrapflags = ' ' . $wrapflags;
$cmocka = ' $(CMOCKA_LIBS)';
}
my $linkflags = join("", map { $_." " } @linkdirs);
my $linklibs = join("", map { $_." " } @linklibs);
my $cmd = '$(CC)';
Expand All @@ -2038,10 +2049,10 @@ EOF
return <<"EOF";
$bin: $deps
rm -f $bin
\$\${LDCMD:-$cmd} $cmdflags $linkflags\$(BIN_LDFLAGS) \\
\$\${LDCMD:-$cmd} $cmdflags $linkflags\$(BIN_LDFLAGS)$wrapflags \\
-o $bin \\
$objs \\
$linklibs\$(BIN_EX_LIBS)
$linklibs\$(BIN_EX_LIBS)$cmocka
EOF
}
sub in2script {
Expand Down
51 changes: 49 additions & 2 deletions Configure
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ my @disablables_features = (
"ubsan",
"ui-console",
"unit-test",
"unit-tests",
"uplink",
"weak-ssl-ciphers",
"zlib-dynamic",
Expand Down Expand Up @@ -654,6 +655,7 @@ our %disabled = ( # "what" => "comment"
"trace" => "default",
"ubsan" => "default",
"unit-test" => "default",
"unit-tests" => "default",
"weak-ssl-ciphers" => "default",
"zlib" => "default",
"zlib-dynamic" => "default",
Expand Down Expand Up @@ -723,7 +725,7 @@ my @disable_cascades = (

"stdio" => [ "apps", "egd" ],
"apps" => [ "tests" ],
"tests" => [ "external-tests" ],
"tests" => [ "external-tests", "unit-tests" ],
"comp" => [ "zlib", "brotli", "zstd" ],
"sm3" => [ "sm2" ],
sub { !$disabled{"unit-test"} } => [ "heartbeats" ],
Expand Down Expand Up @@ -1115,6 +1117,14 @@ while (@argvcopy)
{
$withargs{fuzzer_include}=$1;
}
elsif (/^--with-cmocka-lib=(.*)$/)
{
$withargs{cmocka_lib}=$1;
}
elsif (/^--with-cmocka-include=(.*)$/)
{
$withargs{cmocka_include}=$1;
}
elsif (/^--with-rand-seed=(.*)$/)
{
foreach my $x (split(m|,|, $1))
Expand Down Expand Up @@ -1671,8 +1681,13 @@ unless ($disabled{asan} || defined $detected_sanitizers{asan}) {
$config{target} =~ /^VC-/ ? "/fsanitize=address" : "-fsanitize=address";
}

my %predefined_C = compiler_predefined($config{CROSS_COMPILE}.$config{CC});

unless ($disabled{ubsan} || defined $detected_sanitizers{ubsan}) {
push @{$config{cflags}}, "-fsanitize=undefined", "-fno-sanitize-recover=all", "-DPEDANTIC";
if ($predefined_C{__clang__}) {
push @{$config{cflags}}, "-fno-sanitize=function";
}
}

unless ($disabled{msan} || defined $detected_sanitizers{msan}) {
Expand Down Expand Up @@ -1752,7 +1767,6 @@ if ($target{sys_id} ne "")
push @{$config{openssl_sys_defines}}, "OPENSSL_SYS_$target{sys_id}";
}

my %predefined_C = compiler_predefined($config{CROSS_COMPILE}.$config{CC});
my %predefined_CXX = $config{CXX}
? compiler_predefined($config{CROSS_COMPILE}.$config{CXX})
: ();
Expand Down Expand Up @@ -1913,6 +1927,18 @@ unless ($disabled{winstore}) {

push @{$config{openssl_other_defines}}, "OPENSSL_NO_KTLS" if ($disabled{ktls});

unless ($disabled{"unit-tests"}) {
if ($target =~ /^linux/ || $target =~ /^BSD/) {
$config{cmocka_includes} =
$withargs{cmocka_include} ? [$withargs{cmocka_include}] : [];
$config{cmocka_libs} = $withargs{cmocka_lib}
? "-L$withargs{cmocka_lib} -lcmocka"
: "-lcmocka";
} else {
disable('no-wrap-support', 'unit-tests');
}
}

# Get the extra flags used when building shared libraries and modules. We
# do this late because some of them depend on %disabled.

Expand Down Expand Up @@ -2137,6 +2163,7 @@ if ($builder eq "unified") {
my %includes = ();
my %defines = ();
my %depends = ();
my %wraps = ();
my %generate = ();
my %imagedocs = ();
my %htmldocs = ();
Expand Down Expand Up @@ -2392,6 +2419,11 @@ if ($builder eq "unified") {
\$attributes{depends}, $+{ATTRIBS},
tokenize($expand_variables->($+{VALUE})))
if !@skip || $skip[$#skip] > 0; },
qr/^\s* WRAP ${index_re} \s* = \s* ${value_re} \s* $/x
=> sub { $push_to->(\%wraps, $expand_variables->($+{INDEX}),
undef, undef,
tokenize($expand_variables->($+{VALUE})))
if !@skip || $skip[$#skip] > 0; },
qr/^\s* GENERATE ${index_re} ${attribs_re} \s* = \s* ${value_re} \s* $/x
=> sub { $push_to->(\%generate, $expand_variables->($+{INDEX}),
\$attributes{generate}, $+{ATTRIBS},
Expand Down Expand Up @@ -2678,6 +2710,13 @@ if ($builder eq "unified") {
}
}

foreach my $dest (keys %wraps) {
my $ddest = cleanfile($buildd, $dest, $blddir);
foreach my $fn (@{$wraps{$dest}}) {
push @{$unified_info{wraps}->{$ddest}}, $fn;
}
}

foreach my $section (keys %imagedocs) {
foreach (@{$imagedocs{$section}}) {
my $imagedocs = cleanfile($buildd, $_, $blddir);
Expand Down Expand Up @@ -3010,6 +3049,14 @@ EOF
}
}

# Add cmocka include path to all targets that use WRAP
if (!$disabled{"unit-tests"} && @{$config{cmocka_includes} // []}) {
foreach my $dest (keys %{$unified_info{wraps} // {}}) {
push @{$unified_info{includes}->{$dest}},
@{$config{cmocka_includes}};
}
}

# For the schemes that need it, we provide the old *_obj configs
# from the *_asm_obj ones
foreach (grep /_(asm|aux)_src$/, keys %target) {
Expand Down
26 changes: 25 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,22 @@ The names of the libraries are:
* brotlidec.lib
* brotlienc.lib

### with-cmocka-include

--with-cmocka-include=DIR

The directory for the location of the cmocka include file. This option is only
necessary if [enable-unit-tests](#enable-unit-tests) is used and the include
file is not already on the system include path.

### with-cmocka-lib

--with-cmocka-lib=DIR

The directory containing the cmocka library. This option is only necessary if
[enable-unit-tests](#enable-unit-tests) is used and the library is not already
on the system library path.

### with-zlib-include

--with-zlib-include=DIR
Expand Down Expand Up @@ -817,6 +833,12 @@ external test suites are currently supported:
See the file [test/README-external.md](test/README-external.md)
for further details.

### enable-unit-tests

Enable building and running unit tests.

This works only on platforms supporting ld `--wrap` option like Linux and BSD.

### no-filenames

Don't compile in filename and line number information (e.g. for errors and
Expand Down Expand Up @@ -1094,10 +1116,12 @@ The User Interface console method enables text based console prompts.

### enable-unit-test

Enable additional unit test APIs.
Enable exposing SSL_test_functions for overwriting ssl_init_wbio_buffer.

This should not typically be used in production deployments.

This option is deprecated and will be removed in OpenSSL 5.0.

### no-uplink

Don't build support for UPLINK interface.
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,10 @@ The manual pages for the master branch and all current stable releases are
available online.

- [OpenSSL master](https://docs.openssl.org/master/)
- [OpenSSL 4.0](https://docs.openssl.org/4.0/)
- [OpenSSL 3.6](https://docs.openssl.org/3.6/)
- [OpenSSL 3.5](https://docs.openssl.org/3.5/)
- [OpenSSL 3.4](https://docs.openssl.org/3.4/)
- [OpenSSL 3.3](https://docs.openssl.org/3.3/)
- [OpenSSL 3.2](https://docs.openssl.org/3.2/)
- [OpenSSL 3.0](https://docs.openssl.org/3.0/)

Demos
Expand Down
17 changes: 12 additions & 5 deletions apps/lib/apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1849,11 +1849,18 @@ CA_DB *load_index(const char *dbfile, DB_ATTR *db_attr)
goto err;

#ifndef OPENSSL_NO_POSIX_IO
BIO_get_fp(in, &dbfp);
if (fstat(fileno(dbfp), &dbst) == -1) {
ERR_raise_data(ERR_LIB_SYS, errno,
"calling fstat(%s)", dbfile);
goto err;
if (BIO_get_fp(in, &dbfp) > 0 && dbfp != NULL) {
if (fstat(fileno(dbfp), &dbst) == -1) {
ERR_raise_data(ERR_LIB_SYS, errno,
"calling fstat(%s)", dbfile);
goto err;
}
} else {
if (stat(dbfile, &dbst) == -1) {
ERR_raise_data(ERR_LIB_SYS, errno,
"calling stat(%s)", dbfile);
goto err;
}
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion apps/lib/vms_term_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ static int CreateSocketPair(int SocketFamily,
SocketPair[0] = SockDesc2;
SocketPair[1] = socket_fd(TcpDeviceChan);

return (0);
return 0;
}

/*----------------------------------------------------------------------------*/
Expand Down
Loading
Loading