The branch master has been updated
via 009e9d99a325992096b6112c16b190e47fd1d166 (commit)
via 2443030466c3715a9c48770022df72dab7acbb51 (commit)
via f564acdaf5edc4ef4ce296221fd3ec4fd3276d1a (commit)
via 7281cbaaa73368b44b148948debd38b9b60271e0 (commit)
via 8976eb249aa4aae8c5c7a6f59a512cd22d2a9b8e (commit)
via 0e474b8b6f328a4fadca7f4689e13d60f1d90515 (commit)
via 4b72d5f80cd6f63329aa45936d84093c19e609d0 (commit)
from f89ee71bc81017e04ac50f570d8aed87f495bcf2 (commit)
- Log -----------------------------------------------------------------
commit 009e9d99a325992096b6112c16b190e47fd1d166
Author: Richard Levitte <[email protected]>
Date: Mon Nov 2 16:48:53 2015 +0100
Remove the state parameter from BIO_ctrl_set_connected
The actual implementation has the state of the connection being
controlled with the peer parameter, non-NULL meaning connected and
NULL meaning connected.
Reviewed-by: Andy Polyakov <[email protected]>
commit 2443030466c3715a9c48770022df72dab7acbb51
Author: Richard Levitte <[email protected]>
Date: Mon Nov 2 16:43:28 2015 +0100
BIO_s_datagram() ctrl doesn't support SEEK/TELL, so don't pretend it does
Reviewed-by: Andy Polyakov <[email protected]>
commit f564acdaf5edc4ef4ce296221fd3ec4fd3276d1a
Author: Richard Levitte <[email protected]>
Date: Sun Nov 1 15:56:21 2015 +0100
Correct or add comments indicating what controls belong to what
Reviewed-by: Andy Polyakov <[email protected]>
commit 7281cbaaa73368b44b148948debd38b9b60271e0
Author: Richard Levitte <[email protected]>
Date: Sun Nov 1 15:48:58 2015 +0100
Remove PROXY controls that aren't used anywhere
Reviewed-by: Andy Polyakov <[email protected]>
commit 8976eb249aa4aae8c5c7a6f59a512cd22d2a9b8e
Author: Richard Levitte <[email protected]>
Date: Sun Nov 1 15:47:41 2015 +0100
Remove dummy argument from BIO_get_bind_mode
Reviewed-by: Andy Polyakov <[email protected]>
commit 0e474b8b6f328a4fadca7f4689e13d60f1d90515
Author: Richard Levitte <[email protected]>
Date: Sun Nov 1 15:45:49 2015 +0100
Document how BIO_get_conn_ip and BIO_get_conn_int_port actually work
No dummy arguments.
Reviewed-by: Andy Polyakov <[email protected]>
commit 4b72d5f80cd6f63329aa45936d84093c19e609d0
Author: Richard Levitte <[email protected]>
Date: Sun Nov 1 15:42:04 2015 +0100
Have BIO_get_conn_int_port use BIO_ctrl instead BIO_int_ctrl
BIO_int_ctrl isn't made for the purpose BIO_get_conn_int_port used it
for.
This also changes BIO_C_GET_CONNECT to actually return the port
instead of assigning it to a pointer that was never returned back to
the caller.
Reviewed-by: Andy Polyakov <[email protected]>
-----------------------------------------------------------------------
Summary of changes:
crypto/bio/bss_conn.c | 31 ++++++++++++++++++++-----------
crypto/bio/bss_dgram.c | 2 --
doc/crypto/BIO_s_accept.pod | 2 +-
doc/crypto/BIO_s_connect.pod | 4 ++--
include/openssl/bio.h | 37 +++++++++++++------------------------
5 files changed, 36 insertions(+), 40 deletions(-)
diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c
index 49b0f69..ba009aa 100644
--- a/crypto/bio/bss_conn.c
+++ b/crypto/bio/bss_conn.c
@@ -403,7 +403,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
{
BIO *dbio;
int *ip;
- const char **pptr;
+ const char **pptr = NULL;
long ret = 1;
BIO_CONNECT *data;
@@ -426,19 +426,28 @@ static long conn_ctrl(BIO *b, int cmd, long num, void
*ptr)
case BIO_C_GET_CONNECT:
if (ptr != NULL) {
pptr = (const char **)ptr;
- if (num == 0) {
- *pptr = data->param_hostname;
+ }
- } else if (num == 1) {
- *pptr = data->param_port;
- } else if (num == 2) {
- *pptr = (char *)&(data->ip[0]);
- } else if (num == 3) {
- *((int *)ptr) = data->port;
+ if (b->init) {
+ if (pptr != NULL) {
+ ret = 1;
+ if (num == 0) {
+ *pptr = data->param_hostname;
+ } else if (num == 1) {
+ *pptr = data->param_port;
+ } else if (num == 2) {
+ *pptr = (char *)&(data->ip[0]);
+ } else {
+ ret = 0;
+ }
+ }
+ if (num == 3) {
+ ret = data->port;
}
- if ((!b->init) || (ptr == NULL))
+ } else {
+ if (pptr != NULL)
*pptr = "not initialized";
- ret = 1;
+ ret = 0;
}
break;
case BIO_C_SET_CONNECT:
diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c
index e7371c9..9c6af4b 100644
--- a/crypto/bio/bss_dgram.c
+++ b/crypto/bio/bss_dgram.c
@@ -512,10 +512,8 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void
*ptr)
switch (cmd) {
case BIO_CTRL_RESET:
num = 0;
- case BIO_C_FILE_SEEK:
ret = 0;
break;
- case BIO_C_FILE_TELL:
case BIO_CTRL_INFO:
ret = 0;
break;
diff --git a/doc/crypto/BIO_s_accept.pod b/doc/crypto/BIO_s_accept.pod
index 80a8348..87d24a8 100644
--- a/doc/crypto/BIO_s_accept.pod
+++ b/doc/crypto/BIO_s_accept.pod
@@ -21,7 +21,7 @@ BIO_get_bind_mode, BIO_do_accept - accept BIO
long BIO_set_accept_bios(BIO *b, char *bio);
long BIO_set_bind_mode(BIO *b, long mode);
- long BIO_get_bind_mode(BIO *b, long dummy);
+ long BIO_get_bind_mode(BIO *b);
#define BIO_BIND_NORMAL 0
#define BIO_BIND_REUSEADDR_IF_UNUSED 1
diff --git a/doc/crypto/BIO_s_connect.pod b/doc/crypto/BIO_s_connect.pod
index 4efd567..7582432 100644
--- a/doc/crypto/BIO_s_connect.pod
+++ b/doc/crypto/BIO_s_connect.pod
@@ -21,8 +21,8 @@ BIO_set_nbio, BIO_do_connect - connect BIO
long BIO_set_conn_int_port(BIO *b, char *port);
char *BIO_get_conn_hostname(BIO *b);
char *BIO_get_conn_port(BIO *b);
- char *BIO_get_conn_ip(BIO *b, dummy);
- long BIO_get_conn_int_port(BIO *b, int port);
+ char *BIO_get_conn_ip(BIO *b);
+ long BIO_get_conn_int_port(BIO *b);
long BIO_set_nbio(BIO *b, long n);
diff --git a/include/openssl/bio.h b/include/openssl/bio.h
index f0fbc5b..09a9510 100644
--- a/include/openssl/bio.h
+++ b/include/openssl/bio.h
@@ -95,8 +95,8 @@ extern "C" {
# define BIO_TYPE_BASE64 (11|0x0200)/* filter */
# define BIO_TYPE_CONNECT (12|0x0400|0x0100)/* socket - connect */
# define BIO_TYPE_ACCEPT (13|0x0400|0x0100)/* socket for accept */
-# define BIO_TYPE_PROXY_CLIENT (14|0x0200)/* client proxy BIO */
-# define BIO_TYPE_PROXY_SERVER (15|0x0200)/* server proxy BIO */
+/* # define BIO_TYPE_PROXY_CLIENT (14|0x0200)*/ /* client proxy BIO */
+/* # define BIO_TYPE_PROXY_SERVER (15|0x0200)*/ /* server proxy BIO */
# define BIO_TYPE_NBIO_TEST (16|0x0200)/* server proxy BIO */
# define BIO_TYPE_NULL_FILTER (17|0x0200)
# define BIO_TYPE_BER (18|0x0200)/* BER -> bin filter */
@@ -398,7 +398,7 @@ struct bio_dgram_sctp_prinfo {
# define BIO_C_SET_CONNECT 100
# define BIO_C_DO_STATE_MACHINE 101
# define BIO_C_SET_NBIO 102
-# define BIO_C_SET_PROXY_PARAM 103
+/* # define BIO_C_SET_PROXY_PARAM 103 */
# define BIO_C_SET_FD 104
# define BIO_C_GET_FD 105
# define BIO_C_SET_FILE_PTR 106
@@ -416,7 +416,7 @@ struct bio_dgram_sctp_prinfo {
# define BIO_C_SET_ACCEPT 118
# define BIO_C_SSL_MODE 119
# define BIO_C_GET_MD_CTX 120
-# define BIO_C_GET_PROXY_PARAM 121
+/* # define BIO_C_GET_PROXY_PARAM 121 */
# define BIO_C_SET_BUFF_READ_DATA 122/* data to read first */
# define BIO_C_GET_CONNECT 123
# define BIO_C_GET_ACCEPT 124
@@ -466,11 +466,11 @@ struct bio_dgram_sctp_prinfo {
# define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0)
# define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1)
# define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2)
-# define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3,0)
+# define BIO_get_conn_int_port(b) BIO_ctrl(b,BIO_C_GET_CONNECT,3,0,NULL)
# define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
-/* BIO_s_accept_socket() */
+/* BIO_s_accept() */
# define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char
*)name)
# define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0)
/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */
@@ -481,33 +481,22 @@ struct bio_dgram_sctp_prinfo {
# define BIO_BIND_REUSEADDR_IF_UNUSED 1
# define BIO_BIND_REUSEADDR 2
# define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)
-# define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)
+# define BIO_get_bind_mode(b) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)
+/* BIO_s_accept() and BIO_s_connect() */
# define BIO_do_connect(b) BIO_do_handshake(b)
# define BIO_do_accept(b) BIO_do_handshake(b)
# define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)
-/* BIO_s_proxy_client() */
-# define BIO_set_url(b,url) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,0,(char
*)(url))
-# define BIO_set_proxies(b,p) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,1,(char
*)(p))
-/* BIO_set_nbio(b,n) */
-# define BIO_set_filter_bio(b,s) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,(char
*)(s))
-/* BIO *BIO_get_filter_bio(BIO *bio); */
-# define BIO_set_proxy_cb(b,cb)
BIO_callback_ctrl(b,BIO_C_SET_PROXY_PARAM,3,(void *(*cb)()))
-# define BIO_set_proxy_header(b,sk) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,4,(char
*)sk)
-# define BIO_set_no_connect_return(b,bool)
BIO_int_ctrl(b,BIO_C_SET_PROXY_PARAM,5,bool)
-
-# define BIO_get_proxy_header(b,skp) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,0,(char
*)skp)
-# define BIO_get_proxies(b,pxy_p) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,1,(char
*)(pxy_p))
-# define BIO_get_url(b,url) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char
*)(url))
-# define BIO_get_no_connect_return(b)
BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL)
-
+/* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and
BIO_s_connect() */
# define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)
# define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c)
+/* BIO_s_file() */
# define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp)
# define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp)
+/* BIO_s_fd() and BIO_s_file() */
# define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)
# define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
@@ -600,8 +589,8 @@ int BIO_ctrl_reset_read_request(BIO *b);
/* ctrl macros for dgram */
# define BIO_ctrl_dgram_connect(b,peer) \
(int)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char *)peer)
-# define BIO_ctrl_set_connected(b, state, peer) \
- (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, state, (char *)peer)
+# define BIO_ctrl_set_connected(b,peer) \
+ (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, 0, (char *)peer)
# define BIO_dgram_recv_timedout(b) \
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, NULL)
# define BIO_dgram_send_timedout(b) \
_____
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits