]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Revert "resolved: Fix incorrect use of OpenSSL BUF_MEM"
authorIwan Timmer <irtimmer@gmail.com>
Sat, 15 Jun 2019 19:56:45 +0000 (21:56 +0200)
committerIwan Timmer <irtimmer@gmail.com>
Sat, 15 Jun 2019 19:56:45 +0000 (21:56 +0200)
This reverts commit 18bddeaaf225d5becfc10cd2c6a1d037c90574a2.

Revert this because it does not take the OpenSSL internal read pointer
into considoration. Resulting in padding in packetdata and therefore
broken SSL connections.

src/resolve/resolved-dnstls-openssl.c

index 5d92230075816b78db8e40d3a10050d2ab42348d..f269e4d6487fd6dd0621c3aa41767bc52459404f 100644 (file)
@@ -6,7 +6,6 @@
 
 #include <openssl/bio.h>
 #include <openssl/err.h>
-#include <string.h>
 
 #include "io-util.h"
 #include "resolved-dns-stream.h"
@@ -35,11 +34,9 @@ static int dnstls_flush_write_buffer(DnsStream *stream) {
                         return ss;
                 } else {
                         stream->dnstls_data.write_buffer->length -= ss;
+                        stream->dnstls_data.write_buffer->data += ss;
 
                         if (stream->dnstls_data.write_buffer->length > 0) {
-                                memmove(stream->dnstls_data.write_buffer->data,
-                                        stream->dnstls_data.write_buffer->data + ss,
-                                        stream->dnstls_data.write_buffer->length);
                                 stream->dnstls_events |= EPOLLOUT;
                                 return -EAGAIN;
                         }