projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1ce7235
)
OpenSSL ssl_recv_data(): Include the file descriptor in the log messages
author
Fabian Keil
<fk@fabiankeil.de>
Sat, 3 Oct 2020 11:35:56 +0000
(13:35 +0200)
committer
Fabian Keil
<fk@fabiankeil.de>
Fri, 9 Oct 2020 07:40:39 +0000
(09:40 +0200)
openssl.c
patch
|
blob
|
history
diff --git
a/openssl.c
b/openssl.c
index
4a0e23b
..
95f0fa4
100644
(file)
--- a/
openssl.c
+++ b/
openssl.c
@@
-207,7
+207,10
@@
extern int ssl_send_data(struct ssl_attr *ssl_attr, const unsigned char *buf, si
extern int ssl_recv_data(struct ssl_attr *ssl_attr, unsigned char *buf, size_t max_length)
{
BIO *bio = ssl_attr->openssl_attr.bio;
extern int ssl_recv_data(struct ssl_attr *ssl_attr, unsigned char *buf, size_t max_length)
{
BIO *bio = ssl_attr->openssl_attr.bio;
+ SSL *ssl;
int ret = 0;
int ret = 0;
+ int fd = -1;
+
memset(buf, 0, max_length);
/*
memset(buf, 0, max_length);
/*
@@
-221,12
+224,18
@@
extern int ssl_recv_data(struct ssl_attr *ssl_attr, unsigned char *buf, size_t m
if (ret < 0)
{
log_ssl_errors(LOG_LEVEL_ERROR,
if (ret < 0)
{
log_ssl_errors(LOG_LEVEL_ERROR,
- "Receiving data o
ver TLS/SSL failed"
);
+ "Receiving data o
n socket %d over TLS/SSL failed", fd
);
return -1;
}
return -1;
}
- log_error(LOG_LEVEL_RECEIVED, "TLS: %N", ret, buf);
+ if (BIO_get_ssl(bio, &ssl) == 1)
+ {
+ fd = SSL_get_fd(ssl);
+ }
+
+ log_error(LOG_LEVEL_RECEIVED, "TLS from socket %d: %N",
+ fd, ret, buf);
return ret;
}
return ret;
}