projects
/
privoxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Lowercase the host name in functions that set it
[privoxy.git]
/
openssl.c
diff --git
a/openssl.c
b/openssl.c
index
4a0e23b
..
37b8069
100644
(file)
--- a/
openssl.c
+++ b/
openssl.c
@@
-152,19
+152,27
@@
extern size_t is_ssl_pending(struct ssl_attr *ssl_attr)
extern int ssl_send_data(struct ssl_attr *ssl_attr, const unsigned char *buf, size_t len)
{
BIO *bio = ssl_attr->openssl_attr.bio;
extern int ssl_send_data(struct ssl_attr *ssl_attr, const unsigned char *buf, size_t len)
{
BIO *bio = ssl_attr->openssl_attr.bio;
+ SSL *ssl;
int ret = 0;
int pos = 0; /* Position of unsent part in buffer */
int ret = 0;
int pos = 0; /* Position of unsent part in buffer */
+ int fd = -1;
if (len == 0)
{
return 0;
}
if (len == 0)
{
return 0;
}
+ if (BIO_get_ssl(bio, &ssl) == 1)
+ {
+ fd = SSL_get_fd(ssl);
+ }
+
while (pos < len)
{
int send_len = (int)len - pos;
while (pos < len)
{
int send_len = (int)len - pos;
- log_error(LOG_LEVEL_WRITING, "TLS: %N", send_len, buf+pos);
+ log_error(LOG_LEVEL_WRITING, "TLS on socket %d: %N",
+ fd, send_len, buf+pos);
/*
* Sending one part of the buffer
/*
* Sending one part of the buffer
@@
-176,7
+184,7
@@
extern int ssl_send_data(struct ssl_attr *ssl_attr, const unsigned char *buf, si
if (!BIO_should_retry(bio))
{
log_ssl_errors(LOG_LEVEL_ERROR,
if (!BIO_should_retry(bio))
{
log_ssl_errors(LOG_LEVEL_ERROR,
- "Sending data o
ver TLS/SSL failed"
);
+ "Sending data o
n socket %d over TLS/SSL failed", fd
);
return -1;
}
}
return -1;
}
}
@@
-207,7
+215,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
+232,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;
}