X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Ftls-openssl.c;h=6f10cf5f7d03ca0bba0fd30c36f3d6ee06d0c050;hb=c29da374ab4ea587c810bdc0395443d6b6164fea;hp=ab76492bc75e42f96ca9fdc06a37db96ce570095;hpb=b7663a25f7748a8ed74209e2f6d801ee311b9252;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c index ab76492bc..6f10cf5f7 100644 --- a/src/src/tls-openssl.c +++ b/src/src/tls-openssl.c @@ -1499,9 +1499,9 @@ if (!RAND_status()) gettimeofday(&r.tv, NULL); r.p = getpid(); - RAND_seed((uschar *)(&r), sizeof(r)); - RAND_seed((uschar *)big_buffer, big_buffer_size); - if (addr != NULL) RAND_seed((uschar *)addr, sizeof(addr)); + RAND_seed(US (&r), sizeof(r)); + RAND_seed(US big_buffer, big_buffer_size); + if (addr != NULL) RAND_seed(US addr, sizeof(addr)); if (!RAND_status()) return tls_error(US"RAND_status", host, @@ -2573,11 +2573,10 @@ tls_write(BOOL is_server, const uschar *buff, size_t len, BOOL more) { int outbytes, error, left; SSL *ssl = is_server ? server_ssl : client_ssl; -static uschar * corked = NULL; -static int c_size = 0, c_len = 0; +static gstring * corked = NULL; -DEBUG(D_tls) debug_printf("%s(%p, %d%s)\n", __FUNCTION__, - buff, len, more ? ", more" : ""); +DEBUG(D_tls) debug_printf("%s(%p, %lu%s)\n", __FUNCTION__, + buff, (unsigned long)len, more ? ", more" : ""); /* Lacking a CORK or MSG_MORE facility (such as GnuTLS has) we copy data when "more" is notified. This hack is only ok if small amounts are involved AND only @@ -2586,12 +2585,12 @@ for the responses to the received SMTP MAIL , RCPT, DATA sequence, only. */ if (is_server && (more || corked)) { - corked = string_catn(corked, &c_size, &c_len, buff, len); + corked = string_catn(corked, buff, len); if (more) return len; - buff = CUS corked; - len = c_len; - corked = NULL; c_size = c_len = 0; + buff = CUS corked->s; + len = corked->ptr; + corked = NULL; } for (left = len; left > 0;) @@ -2819,7 +2818,7 @@ if (!RAND_status()) gettimeofday(&r.tv, NULL); r.p = getpid(); - RAND_seed((uschar *)(&r), sizeof(r)); + RAND_seed(US (&r), sizeof(r)); } /* We're after pseudo-random, not random; if we still don't have enough data in the internal PRNG then our options are limited. We could sleep and hope