summaryrefslogtreecommitdiff
path: root/ustream-io-openssl.c
Commit message (Collapse)AuthorAgeFilesLines
* ustream-openssl: fix BIO_method memory leakPetr Štetiar2020-12-101-23/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes following issues as reported by clang-12 LeakSanitizer: $ uclient-fetch-san -q -O /dev/null 'https://expired.badssl.com/' Direct leak of 96 byte(s) in 1 object(s) allocated from: #0 0x49716d in malloc (uclient-fetch-san+0x49716d) #1 0x7f551cbabe58 in CRYPTO_zalloc (/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1+0x17ae58) Indirect leak of 8 byte(s) in 1 object(s) allocated from: #0 0x49716d in malloc (uclient-fetch-san+0x49716d) #1 0x7f551cbb51c5 in CRYPTO_strdup (/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1+0x1841c5) SUMMARY: AddressSanitizer: 104 byte(s) leaked in 2 allocation(s). and Valgrind: $ valgrind --quiet --leak-check=full uclient-fetch -q -O /dev/null 'https://expired.badssl.com/' ==1966== 104 (96 direct, 8 indirect) bytes in 1 blocks are definitely lost in loss record 4 of 9 ==1966== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==1966== by 0x5FC4E58: CRYPTO_zalloc (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1) ==1966== by 0x5EF712F: BIO_meth_new (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1) ==1966== by 0x5C48039: ustream_bio_new (ustream-io-openssl.c:125) ==1966== by 0x5C48039: ustream_set_io (ustream-io-openssl.c:141) ==1966== by 0x5C47CB0: _ustream_ssl_init (ustream-ssl.c:210) ==1966== by 0x4E4117A: uclient_setup_https (uclient-http.c:914) ==1966== by 0x4E4117A: uclient_http_connect (uclient-http.c:936) ==1966== by 0x401FD9: init_request (uclient-fetch.c:333) ==1966== by 0x401E08: main (uclient-fetch.c:745) Suggested-by: Pan Chen <serial115200@outlook.com> Signed-off-by: Petr Štetiar <ynezz@true.cz>
* Revert "ustream-ssl: openssl: fix bio memory leak"Daniel Golle2020-12-081-1/+0
| | | | | | | This reverts commit 1651a795864e7a8741cb56e7ddd2208070f2cf47. It doesn't actually compile. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* ustream-ssl: openssl: fix bio memory leakPan Chen2020-11-231-0/+1
| | | | | | free memory of bio method when ustream be freed Signed-off-by: Pan Chen <serial115200@outlook.com>
* ustream-ssl: add openssl-1.1.0 compatibilityEneas U de Queiroz via openwrt-devel2018-07-271-24/+22
| | | | | | | | | | | | | | The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software. Patch to compile ustream-ssl with openssl-1.1.0, maintaining compatibility with openssl 1.0.2. Fixed flag handling in ustream-io-openssl.c. Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
* give the main context a type instead of making it void *Felix Fietkau2014-03-151-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* consume all data after a socket write errorFelix Fietkau2013-06-181-0/+3
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* split cyassl and openssl sources, add ssl library abstractionFelix Fietkau2013-02-041-0/+142
Signed-off-by: Felix Fietkau <nbd@openwrt.org>