openssl/apps
Daiki Ueno 09c1db3399 apps: Use the first detected address family if IPv6 is not available
This is a follow up of 15729bef38.  Even
when the host does not support IPv6 at all, BIO_lookup_ex may now
return IN6ADDR_ANY in addition to INADDR_ANY, as the second element of
the ai_next field.

After eee8a40aa5, the do_server function
prefers the IPv6 address and fails on the BIO_socket call.  This adds
a fallback code to retry with the IPv4 address returned as the first
element to avoid the error.

The failure had been partially avoided in the previous code with
AI_ADDRCONFIG, because getaddrinfo returns only IPv4 address if no
IPv6 address is associated with external interface.  However, it would
be still a problem if the external interface has an IPv6 address
assigned, while the loopback interface doesn't.

Signed-off-by: Daiki Ueno <dueno@redhat.com>

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16074)
2021-07-16 08:58:06 +02:00
..
demoSRP
include apps: add query to allow a command to know of a provider command line option was processed 2021-07-12 09:13:41 +10:00
lib apps: Use the first detected address family if IPv6 is not available 2021-07-16 08:58:06 +02:00
asn1parse.c find-doc-nits: Make -c option (cmd-nits) independent of app build and execution 2021-05-18 13:02:23 +02:00
build.info CMP test server: move apps/{,lib/}cmp_mock_srv.c and apps/{,include/}cmp_mock_srv.h 2021-05-20 16:23:27 +02:00
ca-cert.srl
ca-key.pem
ca-req.pem
ca.c Remove executable mode attributes of non-executable files 2021-07-13 16:04:32 +10:00
CA.pl.in apps/CA.pl.in: restore the quotes around -CAfile, they were there for a reason 2021-06-26 06:43:09 +02:00
cert.pem
ciphers.c APPS: Replace 'OPT_ERR = -1, OPT_EOF = 0, OPT_HELP' by OPT_COMMON macro 2021-05-05 20:48:20 +02:00
client.pem
cmp.c HTTP client: fix use of OSSL_HTTP_adapt_proxy(), which is needed also in cmp.c 2021-06-16 14:36:01 +01:00
cms.c apps: use get_cipher_any() instead of get_cipher() for commands that support these ciphers/modes 2021-06-16 18:32:30 +10:00
crl2pkcs7.c find-doc-nits: Make -c option (cmd-nits) independent of app build and execution 2021-05-18 13:02:23 +02:00
crl.c Add support for ISO 8601 datetime format 2021-06-11 12:39:46 +02:00
ct_log_list.cnf
dgst.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
dhparam.c apps: remove TODOs 2021-06-02 16:30:15 +10:00
dsa512.pem
dsa1024.pem
dsa-ca.pem
dsa-pca.pem
dsa.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
dsap.pem
dsaparam.c Add warning to key/param generating apps on potential delay due to missing entropy 2021-05-25 15:16:54 +02:00
ec.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
ecparam.c apps: Fix the mismatch of SM2 keys keymgmt 2021-05-26 16:57:40 +02:00
enc.c apps: remove AEAD/mode checks that are now redundant 2021-06-16 18:32:30 +10:00
engine.c Update copyright year 2021-05-06 13:03:23 +01:00
errstr.c
fipsinstall.c fipsinstall: use the app's libctx and property query when searching for algorithms 2021-06-15 18:26:47 +10:00
gendsa.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
genpkey.c apps: remove AEAD/mode checks that are now redundant 2021-06-16 18:32:30 +10:00
genrsa.c Add warning to key/param generating apps on potential delay due to missing entropy 2021-05-25 15:16:54 +02:00
info.c Update copyright year 2021-05-06 13:03:23 +01:00
insta.ca.crt
kdf.c kdf: use the app's libctx and property query when searching for algorithms 2021-06-15 18:26:47 +10:00
list.c list: use the app's libctx and property query when searching for algorithms 2021-06-15 18:26:47 +10:00
mac.c coverity: fix 1484540 resource leak 2021-05-12 11:11:53 +10:00
nseq.c Update copyright year 2021-05-06 13:03:23 +01:00
ocsp.c apps/ocsp: Allow -port 0 2021-05-29 07:47:03 +02:00
openssl-vms.cnf
openssl.c APPS: make apps strict on app_RAND_load() and app_RAND_write() failure 2021-04-14 16:48:27 +02:00
openssl.cnf
passwd.c APPS: Replace 'OPT_ERR = -1, OPT_EOF = 0, OPT_HELP' by OPT_COMMON macro 2021-05-05 20:48:20 +02:00
pca-cert.srl
pca-key.pem
pca-req.pem
pkcs7.c APPS: Replace 'OPT_ERR = -1, OPT_EOF = 0, OPT_HELP' by OPT_COMMON macro 2021-05-05 20:48:20 +02:00
pkcs8.c Make the -inform option to be respected if possible 2021-05-06 11:43:32 +01:00
pkcs12.c Don't add the first pkcs12 certificate multiple times 2021-07-09 10:24:32 +10:00
pkey.c APPS: Restore the possibility to combine -pubout with -text 2021-06-10 08:34:09 +02:00
pkeyparam.c APPS: Replace 'OPT_ERR = -1, OPT_EOF = 0, OPT_HELP' by OPT_COMMON macro 2021-05-05 20:48:20 +02:00
pkeyutl.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
prime.c Update copyright year 2021-05-06 13:03:23 +01:00
privkey.pem
progs.pl Make apps/progs.pl not look at apps/progs.c 2021-05-19 19:04:06 +02:00
rand.c APPS: Replace 'OPT_ERR = -1, OPT_EOF = 0, OPT_HELP' by OPT_COMMON macro 2021-05-05 20:48:20 +02:00
rehash.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
req.c Fix 'openssl req' to correctly use the algorithm from '-newkey algo:nnnn' 2021-06-26 10:31:04 +02:00
req.pem
rsa8192.pem
rsa.c Decoding PKCS#8: separate decoding of encrypted and unencrypted PKCS#8 2021-06-09 17:00:10 +02:00
rsautl.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
s512-key.pem
s512-req.pem
s1024key.pem
s1024req.pem
s_client.c Remove "-immedate_renegotiation" option 2021-06-15 12:36:51 +02:00
s_server.c Fix s_server PSK handling 2021-07-09 10:45:36 +10:00
s_time.c s_time: avoid unlikely division by zero 2021-06-30 13:55:09 +10:00
server2.pem
server.pem
server.srl
sess_id.c Update copyright year 2021-05-06 13:03:23 +01:00
smime.c apps: use get_cipher_any() instead of get_cipher() for commands that support these ciphers/modes 2021-06-16 18:32:30 +10:00
speed.c apps: fix Coverity 1451531 Unchecked return value 2021-07-09 09:18:10 +10:00
spkac.c spkac: allow digests other than MD5 to be used for signing 2021-06-15 18:26:34 +10:00
srp.c openssl srp: make index.txt parsing error more verbose 2021-05-24 14:37:00 +02:00
storeutl.c Make the -inform option to be respected if possible 2021-05-06 11:43:32 +01:00
testCA.pem
testdsa.h Replace OSSL_PARAM_BLD_free_params() with OSSL_PARAM_free(). 2021-04-12 16:55:30 +10:00
testrsa.h
timeouts.h
ts.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
tsget.in
verify.c Make the -inform option to be respected if possible 2021-05-06 11:43:32 +01:00
version.c Update copyright year 2021-05-06 13:03:23 +01:00
vms_decc_init.c
x509.c Fix segfault in openssl x509 -modulus 2021-06-26 11:40:34 +10:00