From 561f6f1ed237cb9a5a9020e58a368dd9d351b40b Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Mon, 24 Apr 2017 14:15:49 +0100 Subject: [PATCH] Address review feedback for the SCTP changes Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/3286) --- crypto/bio/b_addr.c | 2 +- doc/man3/BIO_ADDRINFO.pod | 10 +++++++++- test/handshake_helper.c | 5 +++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c index 82c220a2f2..b8e1f96e07 100644 --- a/crypto/bio/b_addr.c +++ b/crypto/bio/b_addr.c @@ -617,7 +617,7 @@ int BIO_lookup(const char *host, const char *service, } /*- - * BIO_lookup - look up the node and service you want to connect to. + * BIO_lookup_ex - look up the node and service you want to connect to. * @node: the node you want to connect to. * @service: the service you want to connect to. * @lookup_type: declare intent with the result, client or server. diff --git a/doc/man3/BIO_ADDRINFO.pod b/doc/man3/BIO_ADDRINFO.pod index 45e6e05761..37a3e6244c 100644 --- a/doc/man3/BIO_ADDRINFO.pod +++ b/doc/man3/BIO_ADDRINFO.pod @@ -52,7 +52,7 @@ IPPROTO_TCP, IPPROTO_UDP or IPPORTO_SCTP. If set to 0 than any protocol can be used. B points at a pointer to hold the start of a B chain. -For the family B, BIO_lookup() will ignore the B +For the family B, BIO_lookup_ex() will ignore the B parameter and expects the B parameter to hold the path to the socket file. @@ -89,6 +89,14 @@ case. All other functions described here return 0 or B when the information they should return isn't available. +=head1 NOTES + +The BIO_lookup_ex() implementation uses the platform provided getaddrinfo() +function. On Linux it is known that specifying 0 for the protocol will not +return any SCTP based addresses when calling getaddrinfo(). Therefore if an SCTP +address is required then the B parameter to BIO_lookup_ex() should be +explicitly set to IPPROTO_SCTP. The same may be true on other platforms. + =head1 HISTORY The BIO_lookup_ex() function was added in OpenSSL 1.1.1. diff --git a/test/handshake_helper.c b/test/handshake_helper.c index 4943e82d83..8ad35ce311 100644 --- a/test/handshake_helper.c +++ b/test/handshake_helper.c @@ -1006,11 +1006,16 @@ static handshake_status_t handshake_status(peer_status_t last_status, int client_spoke_last) { switch (last_status) { + case PEER_WAITING: + /* Shouldn't ever happen */ + return INTERNAL_ERROR; + case PEER_SUCCESS: switch (previous_status) { case PEER_SUCCESS: /* Both succeeded. */ return HANDSHAKE_SUCCESS; + case PEER_WAITING: case PEER_RETRY: /* Let the first peer finish. */ return HANDSHAKE_RETRY; -- 2.34.1