Update with SSLsplit 0.5.2 and develop branch changes as of 270218

pull/13/head
Soner Tari 6 years ago
parent ae69b21908
commit 9d435e180c

@ -1,48 +0,0 @@
# Development
SSLsplit is being developed on Github as [droe/sslsplit][1] and uses
TravisCI for continuous integration.
[![Build Status](https://travis-ci.org/droe/sslsplit.svg?branch=master)](https://travis-ci.org/droe/sslsplit)
[1]: https://github.com/droe/sslsplit
## Reporting bugs
Please use the Github issue tracker for bug reports. Before submitting a bug
report, please check whether the bug is also present in the `develop` branch
and whether running `make test` produces failed unit tests on your system.
## Contributing patches
For patch submissions, please send me pull requests on Github. Ideally, you
fork a separate feature branch off the latest `develop` branch for each of
your contributions (see below). If you have larger changes in mind, feel
free to open an issue first to discuss implications.
If you are interested in contributing and don't know where to start, take a
look at the [open issues][2]. In particular, [porting features over to not
yet supported platforms][3] is always very much appreciated. When submitting
code, even though it is not a requirement, it is still appreciated if you
also update the manual page and other documentation as necessary and include
as many meaningful unit tests for your code as possible.
[2]: https://github.com/droe/sslsplit/issues
[3]: https://github.com/droe/sslsplit/labels/portability
See `LICENSE.md` for licensing and copyright information applying to
contributions. See `AUTHORS.md` for the list of contributors.
## Branching model
With the 0.4.10 release as a starting point, SSLsplit is using [Vincent
Driessen's branching model][4]. The default `master` branch points to the
latest tagged release, while the `develop` branch is where development happens.
When preparing a release, there may or may not be a `release/x.y.z` branch off
`develop`, but in either case, the tagged release is merged back to `master`.
New features are developed in feature branches off the `develop` branch.
[4]: http://nvie.com/posts/a-successful-git-branching-model/

@ -0,0 +1,24 @@
BSD 2-Clause License
Copyright (c) 2009-2018, Daniel Roethlisberger and contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

@ -0,0 +1,10 @@
By contributing to the software, the contributor releases their contribution
under the copyright and license terms of this software. While contributors
retain copyright to their contributions, they grant the main copyright holder
of the software the irrevocable, transferable right to relicense the software
as a whole or in part, including their contributions, under different open
source licenses than the one currently used.
Third-party components included as documented in `LICENSE.third` and the
respective source files do not constitute contribution in this sense and retain
their original copyright and license terms.

@ -1,64 +0,0 @@
# License and copyright
## Copyright
Copyright (c) 2009-2016, Daniel Roethlisberger and contributors.
All rights reserved.
Licensed under the 2-clause BSD license contained herein.
## Third-party components
`khash.h`:
Copyright (c) 2008, 2009, 2011, Attractive Chaos.
All rights reserved.
Licensed under the MIT license.
`xnu/xnu-*`:
Copyright (c) 1988-2015, Apple Inc. and original copyright holders.
All rights reserved.
Licensed under the APSL.
`extra/log*.py`:
Copyright (C) 2015, Maciej Kotowicz and Daniel Roethlisberger.
All rights reserved.
Licensed under a 2-clause BSD license.
See the respective source and/or license files for details.
## Contributions
By contributing to the software, the contributor releases their
contribution under the license and copyright terms herein. While
contributors retain copyright to their contributions, they grant the
main copyright holder of the software the irrevocable, transferable
right to relicense the software as a whole or in part, including their
contributions, under different open source licenses than the one
contained herein.
## License
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions, and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

@ -0,0 +1,22 @@
The software includes the following third-party source code components with
different copyright and license terms:
khash.h:
Copyright (c) 2008, 2009, 2011, Attractive Chaos.
All rights reserved.
Licensed under the MIT license.
xnu/xnu-*:
Copyright (c) 1988-2017, Apple Inc. and original copyright holders.
All rights reserved.
Licensed under the APSL.
extra/log*.py:
Copyright (C) 2015, Maciej Kotowicz and Daniel Roethlisberger.
All rights reserved.
Licensed under a 2-clause BSD license.
See the respective source and/or license files for details.

@ -1,4 +1,26 @@
### SSLsplit develop
- Fix build on FreeBSD 12 (patch-proc.c r436571 from FreeBSD ports).
- Minor bugfixes and improvements.
### SSLsplit 0.5.2 2018-02-10
- Add support for SSLv2 ClientHello handshake format for SSLv3/TLS
connections and while there, essentially fixing autossl for clients using
SSLv2 ClientHello handshake format with SSLv3/TLS (#185).
- Suppress Upgrade header in order to prevent upgrading connections to
WebSockets or HTTP/2 (#91).
- Add -M for writing an SSLKEYLOGFILE compatible log file (issue #184).
- Fix error handling for Darwin libproc functions (-i).
- Fix session cache misses and failed unit tests on MIPS by fixing undefined
behaviour in session cache hash functions (Debian #848919 and #851271).
- Synthesize MAC addresses to avoid the requirement for root privileges and
waiting for ARP timeouts on some platforms in log2pcap.py (issue #169).
- Minor bugfixes and improvements.
### SSLsplit 0.5.1 2018-01-14 ### SSLsplit 0.5.1 2018-01-14
- Dump master key in NSS key log format in debug mode, allowing decryption of - Dump master key in NSS key log format in debug mode, allowing decryption of

@ -4,7 +4,7 @@ Copyright (C) 2017-2018, [Soner Tari](http://comixwall.org).
https://github.com/sonertari/SSLproxy https://github.com/sonertari/SSLproxy
Copyright (C) 2009-2018, [Daniel Roethlisberger](//daniel.roe.ch/). Copyright (C) 2009-2018, [Daniel Roethlisberger](//daniel.roe.ch/).
http://www.roe.ch/SSLsplit https://www.roe.ch/SSLsplit
## Overview ## Overview
@ -71,12 +71,14 @@ important for the program, because it cannot reliably determine if the actual
network traffic it is processing was encrypted or not. network traffic it is processing was encrypted or not.
SSLproxy supports plain TCP, plain SSL, HTTP, HTTPS, POP3, POP3S, SMTP, and SSLproxy supports plain TCP, plain SSL, HTTP, HTTPS, POP3, POP3S, SMTP, and
SMTPS connections over both IPv4 and IPv6. SSLproxy fully supports Server Name SMTPS connections over both IPv4 and IPv6. It also has the ability to
dynamically upgrade plain TCP to SSL in order to generically support SMTP
STARTTLS and similar upgrade mechanisms. SSLproxy fully supports Server Name
Indication (SNI) and is able to work with RSA, DSA and ECDSA keys and DHE and Indication (SNI) and is able to work with RSA, DSA and ECDSA keys and DHE and
ECDHE cipher suites. Depending on the version of OpenSSL, SSLproxy supports ECDHE cipher suites. Depending on the version of OpenSSL, SSLproxy supports
SSL 3.0, TLS 1.0, TLS 1.1 and TLS 1.2, and optionally SSL 2.0 as well. SSL 3.0, TLS 1.0, TLS 1.1 and TLS 1.2, and optionally SSL 2.0 as well.
For SSL/TLS connections, SSLproxy generates and signs forged X509v3 For SSL and HTTPS connections, SSLproxy generates and signs forged X509v3
certificates on-the-fly, mimicking the original server certificate's subject certificates on-the-fly, mimicking the original server certificate's subject
DN, subjectAltName extension and other characteristics. SSLproxy has the DN, subjectAltName extension and other characteristics. SSLproxy has the
ability to use existing certificates of which the private key is available, ability to use existing certificates of which the private key is available,
@ -87,10 +89,11 @@ certificate verification vulnerabilities in SSL/TLS stacks.
SSLproxy implements a number of defenses against mechanisms which would SSLproxy implements a number of defenses against mechanisms which would
normally prevent MitM attacks or make them more difficult. SSLproxy can deny normally prevent MitM attacks or make them more difficult. SSLproxy can deny
OCSP requests in a generic way. For HTTP and HTTPS connections, SSLproxy OCSP requests in a generic way. For HTTP and HTTPS connections, SSLproxy
removes response headers for HPKP in order to prevent server-instructed public mangles headers to prevent server-instructed public key pinning (HPKP), avoid
key pinning, for HSTS to avoid the strict transport security restrictions, and strict transport security restrictions (HSTS), and prevent switching to
Alternate Protocols to prevent switching to QUIC/SPDY. HTTP compression, QUIC/SPDY, HTTP/2 or WebSockets (Upgrade, Alternate Protocols). HTTP
encodings and keep-alive are disabled to make the logs more readable. compression, encodings and keep-alive are disabled to make the logs more
readable.
Another reason to disable persistent connections is to reduce file descriptor Another reason to disable persistent connections is to reduce file descriptor
usage. Accordingly, connections are closed if they remain idle for a certain usage. Accordingly, connections are closed if they remain idle for a certain
@ -104,13 +107,6 @@ SSLsplit accepts all certificates including self-signed ones. See [The Risks of
SSL Inspection](https://insights.sei.cmu.edu/cert/2015/03/the-risks-of-ssl-inspection.html) SSL Inspection](https://insights.sei.cmu.edu/cert/2015/03/the-risks-of-ssl-inspection.html)
for the reasons of this difference. for the reasons of this difference.
SSLproxy does not automagically redirect any network traffic. To actually
implement a proxy, you also need to redirect the traffic to the system
running SSLproxy. Your options include running SSLproxy on a legitimate
router, ARP spoofing, ND spoofing, DNS poisoning, deploying a rogue access
point (e.g. using hostap mode), physical recabling, malicious VLAN
reconfiguration or route injection, /etc/hosts modification and so on.
As SSLproxy is based on SSLsplit, this is a modified SSLsplit README file. As SSLproxy is based on SSLsplit, this is a modified SSLsplit README file.
See the manual page sslproxy(1) for details on using SSLproxy and setting up See the manual page sslproxy(1) for details on using SSLproxy and setting up
the various NAT engines. the various NAT engines.
@ -157,21 +153,23 @@ For more build options see `GNUmakefile`.
## Documentation ## Documentation
See the manual page `sslproxy.1` for user documentation.
See `NEWS.md` for release notes listing significant changes between releases. See `NEWS.md` for release notes listing significant changes between releases.
See `HACKING.md` for information on development and how to submit bug reports.
See `AUTHORS.md` for the list of contributors.
## License ## License
SSLsplit is provided under a 2-clause BSD license. SSLsplit is provided under a 2-clause BSD license.
SSLsplit contains components licensed under the MIT and APSL licenses. SSLsplit contains components licensed under the MIT and APSL licenses.
See `LICENSE.md` and the respective source file headers for details. See `LICENSE`, `LICENSE.contrib` and `LICENSE.third` as well as the respective
source file headers for details.
The modifications for SSLproxy are licensed under the same terms as SSLsplit. The modifications for SSLproxy are licensed under the same terms as SSLsplit.
## Credits ## Credits
See `AUTHORS.md` for the list of contributors.
SSLsplit was inspired by `mitm-ssl` by Claes M. Nyberg and `sslsniff` by Moxie SSLsplit was inspired by `mitm-ssl` by Claes M. Nyberg and `sslsniff` by Moxie
Marlinspike, but shares no source code with them. Marlinspike, but shares no source code with them.

@ -1,28 +1,29 @@
/* /*
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef ATTRIB_H #ifndef ATTRIB_H

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <stdlib.h> #include <stdlib.h>

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef BASE64_H #ifndef BASE64_H

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "base64.h" #include "base64.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "cache.h" #include "cache.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef CACHE_H #ifndef CACHE_H

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "cachedsess.h" #include "cachedsess.h"
@ -44,13 +45,11 @@ static inline khint_t
kh_dynbuf_hash_func(dynbuf_t *b) kh_dynbuf_hash_func(dynbuf_t *b)
{ {
khint_t *p = (khint_t *)b->buf; khint_t *p = (khint_t *)b->buf;
khint_t h; khint_t h = 0;
int rem; int rem;
if ((rem = b->sz % sizeof(khint_t))) { if ((rem = b->sz % sizeof(khint_t))) {
memcpy(&h, b->buf + b->sz - rem, rem); memcpy(&h, b->buf + b->sz - rem, rem);
} else {
h = 0;
} }
while (p < (khint_t*)(b->buf + b->sz - rem)) { while (p < (khint_t*)(b->buf + b->sz - rem)) {

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef CACHEDSESS_H #ifndef CACHEDSESS_H

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "ssl.h" #include "ssl.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "cachefkcrt.h" #include "cachefkcrt.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef CACHEFKCRT_H #ifndef CACHEFKCRT_H

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "ssl.h" #include "ssl.h"

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "cachemgr.h" #include "cachemgr.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef CACHEMGR_H #ifndef CACHEMGR_H

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "cachemgr.h" #include "cachemgr.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "cachessess.h" #include "cachessess.h"
@ -42,13 +43,11 @@ static inline khint_t
kh_dynbuf_hash_func(dynbuf_t *b) kh_dynbuf_hash_func(dynbuf_t *b)
{ {
khint_t *p = (khint_t *)b->buf; khint_t *p = (khint_t *)b->buf;
khint_t h; khint_t h = 0;
int rem; int rem;
if ((rem = b->sz % sizeof(khint_t))) { if ((rem = b->sz % sizeof(khint_t))) {
memcpy(&h, b->buf + b->sz - rem, rem); memcpy(&h, b->buf + b->sz - rem, rem);
} else {
h = 0;
} }
while (p < (khint_t*)(b->buf + b->sz - rem)) { while (p < (khint_t*)(b->buf + b->sz - rem)) {

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef CACHESSESS_H #ifndef CACHESSESS_H

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "ssl.h" #include "ssl.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "cachetgcrt.h" #include "cachetgcrt.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef CACHETGCRT_H #ifndef CACHETGCRT_H

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "ssl.h" #include "ssl.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "cert.h" #include "cert.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef CERT_H #ifndef CERT_H

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "ssl.h" #include "ssl.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef DEFAULTS_H #ifndef DEFAULTS_H

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "dynbuf.h" #include "dynbuf.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef DYNBUF_H #ifndef DYNBUF_H

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "dynbuf.h" #include "dynbuf.h"

@ -1,5 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
# vim: set list et ts=8 sts=4 sw=4 ft=python: # vim: set ft=python list et ts=8 sts=4 sw=4:
# SSLsplit contributed code: Converts sslsplit -L log to PCAP. # SSLsplit contributed code: Converts sslsplit -L log to PCAP.
# This script reads the log from standard input and converts it to a # This script reads the log from standard input and converts it to a
@ -8,37 +8,45 @@
# correspond to the values in the original traffic. Note that the # correspond to the values in the original traffic. Note that the
# algorithms used do not scale well for large volumes of traffic. # algorithms used do not scale well for large volumes of traffic.
# Copyright (C) 2015, Maciej Kotowicz <mak@lokalhost.pl> # Copyright (C) 2015, Maciej Kotowicz <mak@lokalhost.pl>.
# Copyright (C) 2015, Daniel Roethlisberger <daniel@roe.ch> # Copyright (C) 2015, Daniel Roethlisberger <daniel@roe.ch>.
# All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions # modification, are permitted provided that the following conditions
# are met: # are met:
# 1. Redistributions of source code must retain the above copyright # 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions, and the following disclaimer. # notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright # 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the # notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution. # documentation and/or other materials provided with the distribution.
# #
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
import sys import sys
import datetime import datetime
import random import random
import scapy
from scapy.utils import PcapWriter from scapy.utils import PcapWriter
from scapy.all import * from scapy.all import Ether, IP, TCP
import logreader import logreader
# avoid requiring root and waiting for on-the-wire timeouts (issue #169)
def getmacbyip(ip, chainCC=0):
return "11:22:33:44:55:66"
scapy.layers.l2.getmacbyip = getmacbyip
def parse_timestamp(s): def parse_timestamp(s):
return datetime.datetime.strptime(s, '%Y-%m-%d %H:%M:%S %Z') return datetime.datetime.strptime(s, '%Y-%m-%d %H:%M:%S %Z')

@ -1,32 +1,34 @@
#!/usr/bin/env python #!/usr/bin/env python
# vim: set list et ts=8 sts=4 sw=4 ft=python: # vim: set ft=python list et ts=8 sts=4 sw=4:
# SSLsplit contributed code: Log parser for sslsplit -L # SSLsplit contributed code: Log parser for sslsplit -L
# This script reads the log from standard input and parses it. # This script reads the log from standard input and parses it.
# Standard input can point to a file or a named pipe. # Standard input can point to a file or a named pipe.
# Copyright (C) 2015, Maciej Kotowicz <mak@lokalhost.pl> # Copyright (C) 2015, Maciej Kotowicz <mak@lokalhost.pl>.
# Copyright (C) 2015, Daniel Roethlisberger <daniel@roe.ch> # Copyright (C) 2015, Daniel Roethlisberger <daniel@roe.ch>.
# All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions # modification, are permitted provided that the following conditions
# are met: # are met:
# 1. Redistributions of source code must retain the above copyright # 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions, and the following disclaimer. # notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright # 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the # notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution. # documentation and/or other materials provided with the distribution.
# #
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
import sys import sys
import os import os

141
log.c

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "log.h" #include "log.h"
@ -213,6 +213,69 @@ log_dbg_mode(int mode)
dbg_mode = mode; dbg_mode = mode;
} }
/*
* Master key log. Logs master keys in SSLKEYLOGFILE format.
* Uses a logger thread.
*/
logger_t *masterkey_log = NULL;
static int masterkey_fd = -1;
static char *masterkey_fn = NULL;
static int
log_masterkey_preinit(const char *logfile)
{
masterkey_fd = open(logfile, O_WRONLY|O_APPEND|O_CREAT, DFLT_FILEMODE);
if (masterkey_fd == -1) {
log_err_level_printf(LOG_CRIT, "Failed to open '%s' for writing: %s (%i)\n",
logfile, strerror(errno), errno);
return -1;
}
if (!(masterkey_fn = realpath(logfile, NULL))) {
log_err_level_printf(LOG_CRIT, "Failed to realpath '%s': %s (%i)\n",
logfile, strerror(errno), errno);
close(masterkey_fd);
masterkey_fd = -1;
return -1;
}
return 0;
}
static int
log_masterkey_reopencb(void)
{
close(masterkey_fd);
masterkey_fd = open(masterkey_fn, O_WRONLY|O_APPEND|O_CREAT,
DFLT_FILEMODE);
if (masterkey_fd == -1) {
log_err_level_printf(LOG_CRIT, "Failed to open '%s' for writing: %s\n",
masterkey_fn, strerror(errno));
free(masterkey_fn);
masterkey_fn = NULL;
return -1;
}
return 0;
}
/*
* Do the actual write to the open master key log file descriptor.
*/
static ssize_t
log_masterkey_writecb(UNUSED int level, UNUSED void *fh, const void *buf, size_t sz)
{
if (write(masterkey_fd, buf, sz) == -1) {
log_err_level_printf(LOG_CRIT, "Warning: Failed to write to masterkey log:"
" %s\n", strerror(errno));
return -1;
}
return sz;
}
static void
log_masterkey_fini(void)
{
close(masterkey_fd);
}
/* /*
* Connection log. Logs a one-liner to a file-based connection log. * Connection log. Logs a one-liner to a file-based connection log.
@ -1050,6 +1113,17 @@ log_preinit(opts_t *opts)
goto out; goto out;
} }
} }
if (opts->masterkeylog) {
if (log_masterkey_preinit(opts->masterkeylog) == -1)
goto out;
if (!(masterkey_log = logger_new(log_masterkey_reopencb,
NULL, NULL,
log_masterkey_writecb, NULL,
log_exceptcb))) {
log_masterkey_fini();
goto out;
}
}
if (opts->certgendir) { if (opts->certgendir) {
if (!(cert_log = logger_new(NULL, NULL, NULL, log_cert_writecb, if (!(cert_log = logger_new(NULL, NULL, NULL, log_cert_writecb,
NULL, log_exceptcb))) NULL, log_exceptcb)))
@ -1072,12 +1146,17 @@ out:
if (cert_log) { if (cert_log) {
logger_free(cert_log); logger_free(cert_log);
} }
if (masterkey_log) {
log_masterkey_fini();
logger_free(masterkey_log);
}
return -1; return -1;
} }
/* /*
* Close all file descriptors opened by log_preinit; used in privsep parent. * Close all file descriptors opened by log_preinit; used in privsep parent.
* Only undo content and connect log, leave error and debug log functional. * Only undo content, connect and masterkey logs, leave error and debug log
* functional.
*/ */
void void
log_preinit_undo(void) log_preinit_undo(void)
@ -1090,6 +1169,10 @@ log_preinit_undo(void)
log_connect_fini(); log_connect_fini();
logger_free(connect_log); logger_free(connect_log);
} }
if (masterkey_log) {
log_masterkey_fini();
logger_free(masterkey_log);
}
} }
/* /*
@ -1106,6 +1189,9 @@ log_init(opts_t *opts, proxy_ctx_t *ctx, int clisock1, int clisock2)
if (!opts->debug) { if (!opts->debug) {
err_shortcut_logger = 1; err_shortcut_logger = 1;
} }
if (masterkey_log)
if (logger_start(masterkey_log) == -1)
return -1;
if (connect_log) if (connect_log)
if (logger_start(connect_log) == -1) if (logger_start(connect_log) == -1)
return -1; return -1;
@ -1139,6 +1225,8 @@ log_fini(void)
if (cert_log) if (cert_log)
logger_leave(cert_log); logger_leave(cert_log);
if (masterkey_log)
logger_leave(masterkey_log);
if (content_log) if (content_log)
logger_leave(content_log); logger_leave(content_log);
if (connect_log) if (connect_log)
@ -1148,6 +1236,8 @@ log_fini(void)
if (cert_log) if (cert_log)
logger_join(cert_log); logger_join(cert_log);
if (masterkey_log)
logger_join(masterkey_log);
if (content_log) if (content_log)
logger_join(content_log); logger_join(content_log);
if (connect_log) if (connect_log)
@ -1157,6 +1247,8 @@ log_fini(void)
if (cert_log) if (cert_log)
logger_free(cert_log); logger_free(cert_log);
if (masterkey_log)
logger_free(masterkey_log);
if (content_log) if (content_log)
logger_free(content_log); logger_free(content_log);
if (connect_log) if (connect_log)
@ -1164,6 +1256,8 @@ log_fini(void)
if (err_log) if (err_log)
logger_free(err_log); logger_free(err_log);
if (masterkey_log)
log_masterkey_fini();
if (content_log) if (content_log)
log_content_file_fini(); log_content_file_fini();
if (connect_log) if (connect_log)
@ -1180,6 +1274,9 @@ log_reopen(void)
{ {
int rv = 0; int rv = 0;
if (masterkey_log)
if (logger_reopen(masterkey_log) == -1)
rv = -1;
if (content_log) if (content_log)
if (logger_reopen(content_log) == -1) if (logger_reopen(content_log) == -1)
rv = -1; rv = -1;

54
log.h

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef LOG_H #ifndef LOG_H
@ -51,6 +51,18 @@ void log_dbg_mode(int);
#define LOG_DBG_MODE_FINER 3 #define LOG_DBG_MODE_FINER 3
#define LOG_DBG_MODE_FINEST 4 #define LOG_DBG_MODE_FINEST 4
extern logger_t *masterkey_log;
#define log_masterkey_printf(fmt, ...) \
logger_printf(masterkey_log, NULL, 0, (fmt), __VA_ARGS__)
#define log_masterkey_print(s) \
logger_print(masterkey_log, NULL, 0, (s))
#define log_masterkey_write(buf, sz) \
logger_write(masterkey_log, NULL, 0, (buf), (sz))
#define log_masterkey_print_free(s) \
logger_print_freebuf(masterkey_log, NULL, 0, (s))
#define log_masterkey_write_free(buf, sz) \
logger_write_freebuf(masterkey_log, 0, NULL, 0, (buf), (sz))
extern logger_t *connect_log; extern logger_t *connect_log;
#define log_connect_printf(fmt, ...) \ #define log_connect_printf(fmt, ...) \
logger_printf(connect_log, NULL, 0, (fmt), __VA_ARGS__) logger_printf(connect_log, NULL, 0, (fmt), __VA_ARGS__)

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "logbuf.h" #include "logbuf.h"
@ -42,15 +42,19 @@
/* /*
* Create new logbuf from provided, pre-allocated buffer, set fd and next. * Create new logbuf from provided, pre-allocated buffer, set fd and next.
* The provided buffer will be freed by logbuf_free() if non-NULL. * The provided buffer will be freed by logbuf_free() if non-NULL, and by
* logbuf_new() in case it fails returning NULL.
*/ */
logbuf_t * logbuf_t *
logbuf_new(int level, void *buf, size_t sz, void *fh, logbuf_t *next) logbuf_new(int level, void *buf, size_t sz, void *fh, logbuf_t *next)
{ {
logbuf_t *lb; logbuf_t *lb;
if (!(lb = malloc(sizeof(logbuf_t)))) if (!(lb = malloc(sizeof(logbuf_t)))) {
if (buf)
free(buf);
return NULL; return NULL;
}
lb->prio = level; lb->prio = level;
lb->buf = buf; lb->buf = buf;
lb->sz = sz; lb->sz = sz;

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef LOGBUF_H #ifndef LOGBUF_H

@ -1,29 +1,29 @@
/* /*
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "logger.h" #include "logger.h"

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef LOGGER_H #ifndef LOGGER_H

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
/* silence daemon(3) deprecation warning on Mac OS X */ /* silence daemon(3) deprecation warning on Mac OS X */
@ -99,7 +99,7 @@ main_version(void)
fprintf(stderr, "https://github.com/sonertari/SSLproxy\n"); fprintf(stderr, "https://github.com/sonertari/SSLproxy\n");
fprintf(stderr, "Copyright (c) 2009-2018, " fprintf(stderr, "Copyright (c) 2009-2018, "
"Daniel Roethlisberger <daniel@roe.ch>\n"); "Daniel Roethlisberger <daniel@roe.ch>\n");
fprintf(stderr, "http://www.roe.ch/SSLsplit\n"); fprintf(stderr, "https://www.roe.ch/SSLsplit\n");
if (build_info[0]) { if (build_info[0]) {
fprintf(stderr, "Build info: %s\n", build_info); fprintf(stderr, "Build info: %s\n", build_info);
} }
@ -193,6 +193,7 @@ main_usage(void)
" e.g. \"/var/log/sslproxy/%%T-%%s-%%d.log\"\n" " e.g. \"/var/log/sslproxy/%%T-%%s-%%d.log\"\n"
#define OPT_i #define OPT_i
#endif /* HAVE_LOCAL_PROCINFO */ #endif /* HAVE_LOCAL_PROCINFO */
" -M logfile log master keys to logfile in SSLKEYLOGFILE format\n"
" -d daemon mode: run in background, log error messages to syslog\n" " -d daemon mode: run in background, log error messages to syslog\n"
" -D debug mode: run in foreground, log debug messages on stderr\n" " -D debug mode: run in foreground, log debug messages on stderr\n"
" -V print version information and exit\n" " -V print version information and exit\n"
@ -661,7 +662,7 @@ main(int argc, char *argv[])
opts->allow_wrong_host = 0; opts->allow_wrong_host = 0;
while ((ch = getopt(argc, argv, OPT_g OPT_G OPT_Z OPT_i "k:c:C:K:t:" while ((ch = getopt(argc, argv, OPT_g OPT_G OPT_Z OPT_i "k:c:C:K:t:"
"OPs:r:R:e:Eu:m:j:p:l:L:S:F:dD::VhW:w:If:q:")) != -1) { "OPs:r:R:e:Eu:m:j:p:l:L:S:F:M:dD::VhW:w:If:q:")) != -1) {
switch (ch) { switch (ch) {
case 'f': case 'f':
if (opts->conffile) if (opts->conffile)
@ -964,6 +965,13 @@ main(int argc, char *argv[])
opts->lprocinfo = 1; opts->lprocinfo = 1;
break; break;
#endif /* HAVE_LOCAL_PROCINFO */ #endif /* HAVE_LOCAL_PROCINFO */
case 'M':
if (opts->masterkeylog)
free(opts->masterkeylog);
opts->masterkeylog = strdup(optarg);
if (!opts->masterkeylog)
oom_die(argv0);
break;
case 'd': case 'd':
opts->detach = 1; opts->detach = 1;
break; break;

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "attrib.h" #include "attrib.h"

42
nat.c

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "nat.h" #include "nat.h"

41
nat.h

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef NAT_H #ifndef NAT_H

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "opts.h" #include "opts.h"
@ -114,6 +114,9 @@ opts_free(opts_t *opts)
if (opts->contentlog_basedir) { if (opts->contentlog_basedir) {
free(opts->contentlog_basedir); free(opts->contentlog_basedir);
} }
if (opts->masterkeylog) {
free(opts->masterkeylog);
}
memset(opts, 0, sizeof(opts_t)); memset(opts, 0, sizeof(opts_t));
free(opts); free(opts);
} }

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef OPTS_H #ifndef OPTS_H
@ -105,6 +105,7 @@ typedef struct opts {
int statslog; int statslog;
char *contentlog; char *contentlog;
char *contentlog_basedir; /* static part of logspec, for privsep srv */ char *contentlog_basedir; /* static part of logspec, for privsep srv */
char *masterkeylog;
CONST_SSL_METHOD *(*sslmethod)(void); CONST_SSL_METHOD *(*sslmethod)(void);
X509 *cacrt; X509 *cacrt;
EVP_PKEY *cakey; EVP_PKEY *cakey;

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "attrib.h" #include "attrib.h"

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "privsep.h" #include "privsep.h"

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef PRIVSEP_H #ifndef PRIVSEP_H

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef __FreeBSD__ #ifdef __FreeBSD__
@ -176,7 +176,11 @@ proc_freebsd_pid_for_addr(pid_t *result, struct sockaddr *src_addr,
struct xinpgen *xig, *exig, *txig; struct xinpgen *xig, *exig, *txig;
struct xtcpcb *xtp; struct xtcpcb *xtp;
#if __FreeBSD_version >= 1200026
struct xinpcb *inp;
#else
struct inpcb *inp; struct inpcb *inp;
#endif
struct xsocket *so; struct xsocket *so;
if (proc_freebsd_getfiles(&xfiles, &nxfiles) == -1) { if (proc_freebsd_getfiles(&xfiles, &nxfiles) == -1) {
@ -198,7 +202,11 @@ proc_freebsd_pid_for_addr(pid_t *result, struct sockaddr *src_addr,
return -1; return -1;
} }
inp = &xtp->xt_inp; inp = &xtp->xt_inp;
#if __FreeBSD_version >= 1200026
so = &inp->xi_socket;
#else
so = &xtp->xt_socket; so = &xtp->xt_socket;
#endif
if (!(so->so_state & SS_ISCONNECTED)) if (!(so->so_state & SS_ISCONNECTED))
/* we are only interested in connected sockets */ /* we are only interested in connected sockets */
@ -317,19 +325,23 @@ proc_darwin_pid_for_addr(pid_t *result, struct sockaddr *src_addr,
/* iterate over all pids to find a matching socket */ /* iterate over all pids to find a matching socket */
int pid_count = proc_listallpids(NULL, 0); int pid_count = proc_listallpids(NULL, 0);
if (pid_count <= 0)
goto errout1;
pids = malloc(sizeof(pid_t) * pid_count); pids = malloc(sizeof(pid_t) * pid_count);
if (!pids) { if (!pids) {
goto errout1; goto errout1;
} }
pid_count = proc_listallpids(pids, sizeof(pid_t) * pid_count); pid_count = proc_listallpids(pids, sizeof(pid_t) * pid_count);
if (pid_count <= 0)
goto errout2;
for (int i = 0; i < pid_count; i++) { for (int i = 0; i < pid_count; i++) {
pid_t pid = pids[i]; pid_t pid = pids[i];
/* fetch fd info for this pid */ /* fetch fd info for this pid */
int fd_count = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, NULL, 0); int fd_count = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, NULL, 0);
if (fd_count == -1) { if (fd_count <= 0) {
/* failed to fetch pidinfo; process may have exited */ /* failed to fetch pidinfo; process may have exited */
continue; continue;
} }
@ -356,7 +368,7 @@ proc_darwin_pid_for_addr(pid_t *result, struct sockaddr *src_addr,
if (proc_pidfdinfo(pid, fd->proc_fd, if (proc_pidfdinfo(pid, fd->proc_fd,
PROC_PIDFDSOCKETINFO, PROC_PIDFDSOCKETINFO,
&sinfo, &sinfo,
sizeof(struct socket_fdinfo)) == -1) { sizeof(struct socket_fdinfo)) <= 0) {
/* process may have exited or socket may have /* process may have exited or socket may have
* been released. */ * been released. */
continue; continue;
@ -420,7 +432,7 @@ proc_darwin_get_info(pid_t pid, char **path, uid_t *uid, gid_t *gid) {
/* fetch process structure */ /* fetch process structure */
struct proc_bsdinfo bsd_info; struct proc_bsdinfo bsd_info;
if (proc_pidinfo(pid, PROC_PIDTBSDINFO, 0, &bsd_info, if (proc_pidinfo(pid, PROC_PIDTBSDINFO, 0, &bsd_info,
sizeof(bsd_info)) == -1) { sizeof(bsd_info)) <= 0) {
return -1; return -1;
} }
@ -433,8 +445,9 @@ proc_darwin_get_info(pid_t pid, char **path, uid_t *uid, gid_t *gid) {
return -1; return -1;
} }
int path_len = proc_pidpath(pid, *path, PROC_PIDPATHINFO_MAXSIZE); int path_len = proc_pidpath(pid, *path, PROC_PIDPATHINFO_MAXSIZE);
if (path_len == -1) { if (path_len <= 0) {
free(*path); free(*path);
*path = NULL;
return -1; return -1;
} }

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef PROC_H #ifndef PROC_H

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "proxy.h" #include "proxy.h"

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef PROXY_H #ifndef PROXY_H

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "pxyconn.h" #include "pxyconn.h"
@ -867,18 +867,14 @@ pxy_sslctx_setoptions(SSL_CTX *sslctx, pxy_conn_ctx_t *ctx)
SSL_CTX_set_options(sslctx, SSL_OP_NO_TICKET); SSL_CTX_set_options(sslctx, SSL_OP_NO_TICKET);
#endif /* SSL_OP_NO_TICKET */ #endif /* SSL_OP_NO_TICKET */
/*
* Do not use HAVE_SSLV2 because we need to set SSL_OP_NO_SSLv2 if it
* is available and WITH_SSLV2 was not used.
*/
#ifdef SSL_OP_NO_SSLv2 #ifdef SSL_OP_NO_SSLv2
#ifdef WITH_SSLV2 #ifdef HAVE_SSLV2
if (ctx->opts->no_ssl2) { if (ctx->opts->no_ssl2) {
#endif /* WITH_SSLV2 */ #endif /* HAVE_SSLV2 */
SSL_CTX_set_options(sslctx, SSL_OP_NO_SSLv2); SSL_CTX_set_options(sslctx, SSL_OP_NO_SSLv2);
#ifdef WITH_SSLV2 #ifdef HAVE_SSLV2
} }
#endif /* WITH_SSLV2 */ #endif /* HAVE_SSLV2 */
#endif /* !SSL_OP_NO_SSLv2 */ #endif /* !SSL_OP_NO_SSLv2 */
#ifdef HAVE_SSLV3 #ifdef HAVE_SSLV3
if (ctx->opts->no_ssl3) { if (ctx->opts->no_ssl3) {
@ -1513,6 +1509,7 @@ pxy_http_reqhdr_filter_line(const char *line, pxy_conn_ctx_t *ctx, int child)
ctx->enomem = 1; ctx->enomem = 1;
return NULL; return NULL;
} }
/* Override Connection: keepalive and Connection: upgrade */
} else if (!strncasecmp(line, "Connection:", 11)) { } else if (!strncasecmp(line, "Connection:", 11)) {
ctx->sent_http_conn_close = 1; ctx->sent_http_conn_close = 1;
if (!(newhdr = strdup("Connection: close"))) { if (!(newhdr = strdup("Connection: close"))) {
@ -1530,7 +1527,11 @@ pxy_http_reqhdr_filter_line(const char *line, pxy_conn_ctx_t *ctx, int child)
(child && ((pxy_conn_child_ctx_t *) ctx)->parent->opts->remove_http_referer)) && (child && ((pxy_conn_child_ctx_t *) ctx)->parent->opts->remove_http_referer)) &&
!strncasecmp(line, "Referer:", 8)) { !strncasecmp(line, "Referer:", 8)) {
return NULL; return NULL;
} else if (!strncasecmp(line, "Keep-Alive:", 11)) { /* Suppress upgrading to SSL/TLS, WebSockets or HTTP/2,
* unsupported encodings, and keep-alive */
} else if (!strncasecmp(line, "Upgrade:", 8) ||
!strncasecmp(line, "Accept-Encoding:", 16) ||
!strncasecmp(line, "Keep-Alive:", 11)) {
return NULL; return NULL;
} else if (child && (!strncasecmp(line, SSLPROXY_KEY, SSLPROXY_KEY_LEN) || } else if (child && (!strncasecmp(line, SSLPROXY_KEY, SSLPROXY_KEY_LEN) ||
// @attention flickr keeps redirecting to https with 301 unless we remove the Via line of squid // @attention flickr keeps redirecting to https with 301 unless we remove the Via line of squid
@ -1620,7 +1621,11 @@ pxy_http_resphdr_filter_line(const char *line, pxy_conn_ctx_t *ctx)
!strncasecmp(line, "Strict-Transport-Security:", 26) || !strncasecmp(line, "Strict-Transport-Security:", 26) ||
/* Alternate Protocol /* Alternate Protocol
* remove to prevent switching to QUIC, SPDY et al */ * remove to prevent switching to QUIC, SPDY et al */
!strncasecmp(line, "Alternate-Protocol:", 19)) { !strncasecmp(line, "Alternate-Protocol:", 19) ||
/* Upgrade header
* remove to prevent upgrading to HTTPS in unhandled ways,
* and more importantly, WebSockets and HTTP/2 */
!strncasecmp(line, "Upgrade:", 8)) {
return NULL; return NULL;
} else if (line[0] == '\0') { } else if (line[0] == '\0') {
ctx->seen_resp_header = 1; ctx->seen_resp_header = 1;
@ -2817,10 +2822,24 @@ pxy_connected_enable(struct bufferevent *bev, pxy_conn_ctx_t *ctx)
pxy_log_connect_nonhttp(ctx); pxy_log_connect_nonhttp(ctx);
} }
/* write SSL certificates to gendir */ if (this->ssl) {
if (this->ssl && (bev == ctx->src.bev) && /* write SSL certificates to gendir */
ctx->opts->certgendir) { if ((bev == ctx->src.bev) && ctx->opts->certgendir) {
pxy_srccert_write(ctx); pxy_srccert_write(ctx);
}
/* log master key */
if (ctx->opts->masterkeylog) {
char *keystr;
keystr = ssl_ssl_masterkey_to_str(this->ssl);
if ((keystr == NULL) ||
(log_masterkey_print_free(keystr) == -1)) {
if (errno == ENOMEM)
ctx->enomem = 1;
pxy_conn_free(ctx, 1);
return 0;
}
}
} }
if (OPTS_DEBUG(ctx->opts)) { if (OPTS_DEBUG(ctx->opts)) {
@ -2837,8 +2856,7 @@ pxy_connected_enable(struct bufferevent *bev, pxy_conn_ctx_t *ctx)
SSL_get_cipher(this->ssl)); SSL_get_cipher(this->ssl));
keystr = ssl_ssl_masterkey_to_str(this->ssl); keystr = ssl_ssl_masterkey_to_str(this->ssl);
if (keystr) { if (keystr) {
log_dbg_printf("%s\n", keystr); log_dbg_print_free(keystr);
free(keystr);
} }
} else { } else {
/* for TCP, we get only a dst connect event, /* for TCP, we get only a dst connect event,

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef PXYCONN_H #ifndef PXYCONN_H

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "pxysslshut.h" #include "pxysslshut.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef PXYSSLSHUT_H #ifndef PXYSSLSHUT_H

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "pxythrmgr.h" #include "pxythrmgr.h"

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef PXYTHRMGR_H #ifndef PXYTHRMGR_H

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "pxythrmgr.h" #include "pxythrmgr.h"

130
ssl.c

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "ssl.h" #include "ssl.h"
@ -576,7 +576,8 @@ ssl_ssl_masterkey_to_str(SSL *ssl)
"%02X%02X%02X%02X%02X%02X%02X%02X" "%02X%02X%02X%02X%02X%02X%02X%02X"
"%02X%02X%02X%02X%02X%02X%02X%02X" "%02X%02X%02X%02X%02X%02X%02X%02X"
"%02X%02X%02X%02X%02X%02X%02X%02X" "%02X%02X%02X%02X%02X%02X%02X%02X"
"%02X%02X%02X%02X%02X%02X%02X%02X", "%02X%02X%02X%02X%02X%02X%02X%02X"
"\n",
r[ 0], r[ 1], r[ 2], r[ 3], r[ 4], r[ 5], r[ 6], r[ 7], r[ 0], r[ 1], r[ 2], r[ 3], r[ 4], r[ 5], r[ 6], r[ 7],
r[ 8], r[ 9], r[10], r[11], r[12], r[13], r[14], r[15], r[ 8], r[ 9], r[10], r[11], r[12], r[13], r[14], r[15],
r[16], r[17], r[18], r[19], r[20], r[21], r[22], r[23], r[16], r[17], r[18], r[19], r[20], r[21], r[22], r[23],
@ -1927,12 +1928,11 @@ ssl_is_ocspreq(const unsigned char *buf, size_t sz)
* message beginning at offsets >= 0, whereas if search is zero, only * message beginning at offsets >= 0, whereas if search is zero, only
* ClientHello messages starting at offset 0 will be considered. * ClientHello messages starting at offset 0 will be considered.
* *
* Note that this code currently only supports SSL 3.0 and TLS 1.0-1.2 and that * This code currently supports SSL 2.0, SSL 3.0 and TLS 1.0-1.2.
* it expects the ClientHello message to be unfragmented in a single record.
*
* TODO - implement SSL 2.0 ClientHello parsing to support old STARTTLS clients
* *
* References: * References:
* draft-hickman-netscape-ssl-00: The SSL Protocol
* RFC 6101: The Secure Sockets Layer (SSL) Protocol Version 3.0
* RFC 2246: The TLS Protocol Version 1.0 * RFC 2246: The TLS Protocol Version 1.0
* RFC 3546: Transport Layer Security (TLS) Extensions * RFC 3546: Transport Layer Security (TLS) Extensions
* RFC 4346: The Transport Layer Security (TLS) Protocol Version 1.1 * RFC 4346: The Transport Layer Security (TLS) Protocol Version 1.1
@ -1973,8 +1973,8 @@ ssl_tls_clienthello_parse(const unsigned char *buf, ssize_t sz, int search,
} }
if (search) { if (search) {
/* Search for the beginning of a potential ClientHello */ /* Search for a potential ClientHello */
while ((n > 0) && (*p != 22)) { while ((n > 0) && (*p != 0x16) && (*p != 0x80)) {
p++; n--; p++; n--;
} }
if (n <= 0) { if (n <= 0) {
@ -1982,7 +1982,8 @@ ssl_tls_clienthello_parse(const unsigned char *buf, ssize_t sz, int search,
* clienthello to NULL to indicate to the * clienthello to NULL to indicate to the
* caller that this buffer does not need to be * caller that this buffer does not need to be
* retried */ * retried */
DBG_printf("===> No match: rv 1, *clienthello NULL\n"); DBG_printf("===> No match:"
" rv 1, *clienthello NULL\n");
*clienthello = NULL; *clienthello = NULL;
return 1; return 1;
} }
@ -1991,9 +1992,68 @@ ssl_tls_clienthello_parse(const unsigned char *buf, ssize_t sz, int search,
DBG_printf("candidate at offset %td\n", p - buf); DBG_printf("candidate at offset %td\n", p - buf);
DBG_printf("byte 0: %02x\n", *p); DBG_printf("byte 0: %02x\n", *p);
/* +0 0x80 +2 0x01 SSLv2 clientHello; /* +0 0x80 +2 0x01 SSLv2 short header, clientHello;
* +0 0x22 +1 0x03 SSLv3/TLSv1.x clientHello */ * +0 0x16 +1 0x03 SSLv3/TLSv1.x handshake, clientHello */
if (*p != 22) { /* record type: handshake protocol */ if (*p == 0x80) {
/* SSLv2 handled here */
p++; n--;
if (n < 10) { /* length + 9 */
DBG_printf("===> [SSLv2] Truncated:"
" rv 1, *clienthello set\n");
return 1;
}
DBG_printf("length: %02x\n", p[0]);
if (n - 1 < p[0]) {
DBG_printf("===> [SSLv2] Truncated:"
" rv 1, *clienthello set\n");
return 1;
}
p++; n--;
DBG_printf("msgtype: %02x\n", p[0]);
if (*p != 0x01)
continue;
p++; n--;
DBG_printf("version: %02x %02x\n", p[0], p[1]);
/* byte order is actually swapped for SSLv2 */
if (!(
#ifdef HAVE_SSLV2
(p[0] == 0x00 && p[1] == 0x02) ||
#endif /* HAVE_SSLV2 */
(p[0] == 0x03 && p[1] <= 0x03)))
continue;
p += 2; n -= 2;
DBG_printf("cipher-spec-len: %02x %02x\n", p[0], p[1]);
ssize_t cipherspec_len = p[0] << 8 | p[1];
p += 2; n -= 2;
DBG_printf("session-id-len: %02x %02x\n", p[0], p[1]);
ssize_t sessionid_len = p[0] << 8 | p[1];
p += 2; n -= 2;
DBG_printf("challenge-len: %02x %02x\n", p[0], p[1]);
ssize_t challenge_len = p[0] << 8 | p[1];
p += 2; n -= 2;
if (challenge_len < 16 || challenge_len > 32)
continue;
if (n < cipherspec_len
+ sessionid_len
+ challenge_len) {
DBG_printf("===> [SSLv2] Truncated:"
" rv 1, *clienthello set\n");
return 1;
}
p += cipherspec_len + sessionid_len + challenge_len;
n -= cipherspec_len + sessionid_len + challenge_len;
goto done_parsing;
} else
if (*p != 0x16) {
/* this can only happen if search is 0 */ /* this can only happen if search is 0 */
DBG_printf("===> No match: rv 1, *clienthello NULL\n"); DBG_printf("===> No match: rv 1, *clienthello NULL\n");
*clienthello = NULL; *clienthello = NULL;
@ -2010,7 +2070,7 @@ ssl_tls_clienthello_parse(const unsigned char *buf, ssize_t sz, int search,
* updated for TLS 1.3 once that is standardized and still * updated for TLS 1.3 once that is standardized and still
* compatible with this parser; remember to also update the * compatible with this parser; remember to also update the
* inner version check below */ * inner version check below */
if (p[0] != 0x03 && p[1] > 0x03) if (p[0] != 0x03 || p[1] > 0x03)
continue; continue;
p += 2; n -= 2; p += 2; n -= 2;
@ -2191,6 +2251,8 @@ ssl_tls_clienthello_parse(const unsigned char *buf, ssize_t sz, int search,
n -= extlen; n -= extlen;
} /* while have more extensions */ } /* while have more extensions */
done_parsing:
;
#ifdef DEBUG_CLIENTHELLO_PARSER #ifdef DEBUG_CLIENTHELLO_PARSER
if (n > 0) { if (n > 0) {
DBG_printf("unparsed next bytes %02x %02x %02x %02x\n", DBG_printf("unparsed next bytes %02x %02x %02x %02x\n",
@ -2205,7 +2267,7 @@ ssl_tls_clienthello_parse(const unsigned char *buf, ssize_t sz, int search,
*servername = sn; *servername = sn;
return 0; return 0;
continue_search: continue_search:
; ;
} while (search && n > 0); } while (search && n > 0);
/* No valid ClientHello messages found, not even a truncated one */ /* No valid ClientHello messages found, not even a truncated one */

42
ssl.h

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef SSL_H #ifndef SSL_H

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "base64.h" #include "base64.h"
@ -237,6 +238,12 @@ START_TEST(ssl_dnsname_match_16)
} }
END_TEST END_TEST
static unsigned char clienthello00[] =
"\x80\x2b\x01\x00\x02\x00\x12\x00\x00\x00\x10\x07\x00\xc0\x03\x00"
"\x80\x01\x00\x80\x06\x00\x40\x04\x00\x80\x02\x00\x80\xe0\xc3\x4a"
"\xc6\xa4\x89\x23\x21\xb1\xbb\x51\xc7\x9c\x06\xa5\xff";
/* SSL 2.0 */
static unsigned char clienthello01[] = static unsigned char clienthello01[] =
"\x80\x67\x01\x03\x00\x00\x4e\x00\x00\x00\x10\x01\x00\x80\x03\x00" "\x80\x67\x01\x03\x00\x00\x4e\x00\x00\x00\x10\x01\x00\x80\x03\x00"
"\x80\x07\x00\xc0\x06\x00\x40\x02\x00\x80\x04\x00\x80\x00\x00\x39" "\x80\x07\x00\xc0\x06\x00\x40\x02\x00\x80\x04\x00\x80\x00\x00\x39"
@ -245,7 +252,7 @@ static unsigned char clienthello01[] =
"\x0a\x00\x00\x15\x00\x00\x12\x00\xfe\xfe\x00\x00\x09\x00\x00\x64" "\x0a\x00\x00\x15\x00\x00\x12\x00\xfe\xfe\x00\x00\x09\x00\x00\x64"
"\x00\x00\x62\x00\x00\x03\x00\x00\x06\xa8\xb8\x93\xbb\x90\xe9\x2a" "\x00\x00\x62\x00\x00\x03\x00\x00\x06\xa8\xb8\x93\xbb\x90\xe9\x2a"
"\xa2\x4d\x6d\xcc\x1c\xe7\x2a\x80\x21"; "\xa2\x4d\x6d\xcc\x1c\xe7\x2a\x80\x21";
/* SSL 2.0, no TLS extensions */ /* SSL 3.0 in SSL 2.0 record */
static unsigned char clienthello02[] = static unsigned char clienthello02[] =
"\x16\x03\x00\x00\x73\x01\x00\x00\x6f\x03\x00\x00\x34\x01\x1e\x67" "\x16\x03\x00\x00\x73\x01\x00\x00\x6f\x03\x00\x00\x34\x01\x1e\x67"
@ -340,26 +347,47 @@ static unsigned char clienthello06[] =
"\x01\x01"; "\x01\x01";
/* TLS 1.2, SNI extension with hostname "daniel.roe.ch" */ /* TLS 1.2, SNI extension with hostname "daniel.roe.ch" */
START_TEST(ssl_tls_clienthello_parse_00)
{
int rv;
const unsigned char *ch = NULL;
char *sni = (void *)0xDEADBEEF;
rv = ssl_tls_clienthello_parse(clienthello00,
sizeof(clienthello00) - 1,
0, &ch, &sni);
#ifdef HAVE_SSLV2
fail_unless(rv == 0, "rv not 0");
fail_unless(ch != NULL, "ch is NULL");
fail_unless(sni == NULL, "sni not NULL");
#else /* !HAVE_SSLV2 */
fail_unless(rv == 1, "rv not 1");
fail_unless(ch == NULL, "ch not NULL");
fail_unless(sni == (void*)0xDEADBEEF, "sni modified");
#endif /* !HAVE_SSLV2 */
}
END_TEST
START_TEST(ssl_tls_clienthello_parse_01) START_TEST(ssl_tls_clienthello_parse_01)
{ {
int rv; int rv;
const unsigned char *ch = (void *)0xDEADBEEF; const unsigned char *ch = NULL;
char *sni = (void *)0xDEADBEEF; char *sni = (void *)0xDEADBEEF;
rv = ssl_tls_clienthello_parse(clienthello01, rv = ssl_tls_clienthello_parse(clienthello01,
sizeof(clienthello01) - 1, sizeof(clienthello01) - 1,
0, &ch, &sni); 0, &ch, &sni);
fail_unless(rv == 1, "rv not 1"); fail_unless(rv == 0, "rv not 0");
fail_unless(ch == NULL, "ch not NULL"); fail_unless(ch != NULL, "ch is NULL");
fail_unless(sni == (void*)0xDEADBEEF, "sni was modified"); fail_unless(sni == NULL, "sni not NULL");
} }
END_TEST END_TEST
START_TEST(ssl_tls_clienthello_parse_02) START_TEST(ssl_tls_clienthello_parse_02)
{ {
int rv; int rv;
const unsigned char *ch; const unsigned char *ch = NULL;
char *sni; char *sni = (void *)0xDEADBEEF;
rv = ssl_tls_clienthello_parse(clienthello02, rv = ssl_tls_clienthello_parse(clienthello02,
sizeof(clienthello02) - 1, sizeof(clienthello02) - 1,
@ -373,8 +401,8 @@ END_TEST
START_TEST(ssl_tls_clienthello_parse_03) START_TEST(ssl_tls_clienthello_parse_03)
{ {
int rv; int rv;
const unsigned char *ch; const unsigned char *ch = NULL;
char *sni; char *sni = NULL;
rv = ssl_tls_clienthello_parse(clienthello03, rv = ssl_tls_clienthello_parse(clienthello03,
sizeof(clienthello03) - 1, sizeof(clienthello03) - 1,
@ -389,8 +417,8 @@ END_TEST
START_TEST(ssl_tls_clienthello_parse_04) START_TEST(ssl_tls_clienthello_parse_04)
{ {
int rv; int rv;
const unsigned char *ch; const unsigned char *ch = NULL;
char *sni; char *sni = NULL;
rv = ssl_tls_clienthello_parse(clienthello04, rv = ssl_tls_clienthello_parse(clienthello04,
sizeof(clienthello04) - 1, sizeof(clienthello04) - 1,
@ -406,7 +434,7 @@ START_TEST(ssl_tls_clienthello_parse_05)
{ {
for (size_t i = 0; i < sizeof(clienthello04) - 1; i++) { for (size_t i = 0; i < sizeof(clienthello04) - 1; i++) {
int rv; int rv;
const unsigned char *ch; const unsigned char *ch = NULL;
char *sni = (void*)0xDEADBEEF; char *sni = (void*)0xDEADBEEF;
ssize_t sz; ssize_t sz;
@ -422,8 +450,8 @@ END_TEST
START_TEST(ssl_tls_clienthello_parse_06) START_TEST(ssl_tls_clienthello_parse_06)
{ {
int rv; int rv;
const unsigned char *ch; const unsigned char *ch = NULL;
char *sni; char *sni = NULL;
rv = ssl_tls_clienthello_parse(clienthello05, rv = ssl_tls_clienthello_parse(clienthello05,
sizeof(clienthello05) - 1, sizeof(clienthello05) - 1,
@ -439,7 +467,7 @@ START_TEST(ssl_tls_clienthello_parse_07)
{ {
for (size_t i = 0; i < sizeof(clienthello05) - 1; i++) { for (size_t i = 0; i < sizeof(clienthello05) - 1; i++) {
int rv; int rv;
const unsigned char *ch; const unsigned char *ch = NULL;
char *sni = (void*)0xDEADBEEF; char *sni = (void*)0xDEADBEEF;
ssize_t sz; ssize_t sz;
@ -455,7 +483,7 @@ END_TEST
START_TEST(ssl_tls_clienthello_parse_08) START_TEST(ssl_tls_clienthello_parse_08)
{ {
int rv; int rv;
const unsigned char *ch; const unsigned char *ch = (void *)0xDEADBEEF;
char *sni = (void *)0xDEADBEEF; char *sni = (void *)0xDEADBEEF;
rv = ssl_tls_clienthello_parse(clienthello06, rv = ssl_tls_clienthello_parse(clienthello06,
@ -470,8 +498,8 @@ END_TEST
START_TEST(ssl_tls_clienthello_parse_09) START_TEST(ssl_tls_clienthello_parse_09)
{ {
int rv; int rv;
const unsigned char *ch; const unsigned char *ch = NULL;
char *sni; char *sni = NULL;
rv = ssl_tls_clienthello_parse(clienthello06, rv = ssl_tls_clienthello_parse(clienthello06,
sizeof(clienthello06) - 1, sizeof(clienthello06) - 1,
@ -487,7 +515,7 @@ END_TEST
START_TEST(ssl_tls_clienthello_parse_10) START_TEST(ssl_tls_clienthello_parse_10)
{ {
int rv; int rv;
const unsigned char *ch; const unsigned char *ch = NULL;
rv = ssl_tls_clienthello_parse(clienthello06, rv = ssl_tls_clienthello_parse(clienthello06,
sizeof(clienthello06) - 1, sizeof(clienthello06) - 1,
@ -718,6 +746,7 @@ ssl_suite(void)
suite_add_tcase(s, tc); suite_add_tcase(s, tc);
tc = tcase_create("ssl_tls_clienthello_parse"); tc = tcase_create("ssl_tls_clienthello_parse");
tcase_add_test(tc, ssl_tls_clienthello_parse_00);
tcase_add_test(tc, ssl_tls_clienthello_parse_01); tcase_add_test(tc, ssl_tls_clienthello_parse_01);
tcase_add_test(tc, ssl_tls_clienthello_parse_02); tcase_add_test(tc, ssl_tls_clienthello_parse_02);
tcase_add_test(tc, ssl_tls_clienthello_parse_03); tcase_add_test(tc, ssl_tls_clienthello_parse_03);

@ -1,32 +1,33 @@
.\"-
.\" SSLproxy - transparent SSL/TLS proxy for diverting packets to programs .\" SSLproxy - transparent SSL/TLS proxy for diverting packets to programs
.\" Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com>
.\" Copyright (c) 2009-2016, Daniel Roethlisberger <daniel@roe.ch>
.\" All rights reserved.
.\" https://github.com/sonertari/SSLproxy .\" https://github.com/sonertari/SSLproxy
.\" http://www.roe.ch/SSLsplit .\"
.\" Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
.\" Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com>.
.\" All rights reserved.
.\" .\"
.\" The modifications for SSLproxy are licensed under the same terms as .\" The modifications for SSLproxy are licensed under the same terms as
.\" SSLsplit. .\" SSLsplit.
.\" .\"
.\" Redistribution and use in source and binary forms, with or without .\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions .\" modification, are permitted provided that the following conditions are met:
.\" are met: .\" 1. Redistributions of source code must retain the above copyright notice,
.\" 1. Redistributions of source code must retain the above copyright .\" this list of conditions and the following disclaimer.
.\" notice, this list of conditions, and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright notice,
.\" 2. Redistributions in binary form must reproduce the above copyright .\" this list of conditions and the following disclaimer in the documentation
.\" notice, this list of conditions and the following disclaimer in the .\" and/or other materials provided with the distribution.
.\" documentation and/or other materials provided with the distribution.
.\" .\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\" .\"
.TH SSLPROXY 1 "9 February 2018" .TH SSLPROXY 1 "9 February 2018"
.SH NAME .SH NAME
@ -34,18 +35,18 @@ sslproxy \-\- transparent SSL/TLS proxy for diverting packets to programs
.SH SYNOPSIS .SH SYNOPSIS
.na .na
.B sslproxy .B sslproxy
[\fB-kCKwWOPZdDgGsrReumjplLSFif\fP] \fB-c\fP \fIpem\fP [\fB-kCKqwWOPZdDgGsrReumjplLSFiM\fP] \fB-c\fP \fIpem\fP
\fIproxyspecs\fP [...] \fIproxyspecs\fP [...]
.br .br
.B sslproxy .B sslproxy
[\fB-kCKwWOPZdDgGsrReumjplLSFif\fP] \fB-c\fP \fIpem\fP \fB-t\fP \fIdir\fP [\fB-kCKqwWOPZdDgGsrReumjplLSFiM\fP] \fB-c\fP \fIpem\fP \fB-t\fP \fIdir\fP
\fIproxyspecs\fP [...] \fIproxyspecs\fP [...]
.br .br
.B sslproxy .B sslproxy
[\fB-OPZwWdDgGsrReumjplLSFif\fP] \fB-t\fP \fIdir\fP [\fB-OPZwWdDgGsrReumjplLSFiM\fP] \fB-t\fP \fIdir\fP
\fIproxyspecs\fP [...] \fIproxyspecs\fP [...]
.br .br
.B sslproxy [\fB-kCKwWOPZdDgGsrReumjplLSFi\fP] -f \fIconffile\fP .B sslproxy [\fB-kCKwWOPZdDgGsrReumjplLSFiM\fP] -f \fIconffile\fP
.br .br
.B sslproxy -E .B sslproxy -E
.br .br
@ -86,7 +87,9 @@ that address, instead of sending them to the original destination as it
normally would. normally would.
.LP .LP
SSLproxy supports plain TCP, plain SSL, HTTP, HTTPS, POP3, POP3S, SMTP, and SSLproxy supports plain TCP, plain SSL, HTTP, HTTPS, POP3, POP3S, SMTP, and
SMTPS connections over both IPv4 and IPv6. SSLproxy fully supports Server Name SMTPS connections over both IPv4 and IPv6. It also has the ability to
dynamically upgrade plain TCP to SSL in order to generically support SMTP
STARTTLS and similar upgrade mechanisms. SSLproxy fully supports Server Name
Indication (SNI) and is able to work with RSA, DSA and ECDSA keys and DHE and Indication (SNI) and is able to work with RSA, DSA and ECDSA keys and DHE and
ECDHE cipher suites. Depending on the version of OpenSSL, SSLproxy supports ECDHE cipher suites. Depending on the version of OpenSSL, SSLproxy supports
SSL 3.0, TLS 1.0, TLS 1.1 and TLS 1.2, and optionally SSL 2.0 as well. SSL 3.0, TLS 1.0, TLS 1.1 and TLS 1.2, and optionally SSL 2.0 as well.
@ -101,11 +104,14 @@ certificate verification vulnerabilities in SSL/TLS stacks.
.LP .LP
SSLproxy implements a number of defenses against mechanisms which would SSLproxy implements a number of defenses against mechanisms which would
normally prevent MitM attacks or make them more difficult. SSLproxy can deny normally prevent MitM attacks or make them more difficult. SSLproxy can deny
OCSP requests in a generic way. For HTTP and HTTPS connections, SSLproxy OCSP requests in a generic way.
removes response headers for HPKP in order to prevent server-instructed public For HTTP and HTTPS connections, SSLsplit mangles headers to
key pinning, for HSTS to avoid the strict transport security restrictions, and prevent server-instructed public key pinning (HPKP),
Alternate Protocols to prevent switching to QUIC/SPDY. HTTP compression, avoid strict transport security restrictions (HSTS),
encodings and keep-alive are disabled to make the logs more readable. and prevent switching to QUIC/SPDY, HTTP/2 or WebSockets (Upgrade,
Alternate Protocols).
HTTP compression, encodings and keep-alive are disabled to make the logs more
readable.
.LP .LP
Another reason to disable persistent connections is to reduce file descriptor Another reason to disable persistent connections is to reduce file descriptor
usage. Accordingly, connections are closed if they remain idle for a certain usage. Accordingly, connections are closed if they remain idle for a certain
@ -234,6 +240,14 @@ SIGUSR1 will cause \fIlogfile\fP to be re-opened.
When dropping privileges using \fB-u\fP, override the target primary group When dropping privileges using \fB-u\fP, override the target primary group
to be set to \fIgroup\fP. to be set to \fIgroup\fP.
.TP .TP
.B \-M \fIlogfile\fP
Log master keys to \fIlogfile\fP in SSLKEYLOGFILE format as defined by Mozilla.
Logging master keys in this format allows for decryption of SSL/TLS traffic
using Wireshark.
Note that unlike browsers implementing this feature, setting the SSLKEYLOGFILE
environment variable has no effect on SSLsplit.
SIGUSR1 will cause \fIlogfile\fP to be re-opened.
.TP
.B \-O .B \-O
Deny all Online Certificate Status Protocol (OCSP) requests on all Deny all Online Certificate Status Protocol (OCSP) requests on all
\fIproxyspecs\fP and for all OCSP servers with an OCSP response of \fIproxyspecs\fP and for all OCSP servers with an OCSP response of
@ -364,7 +378,8 @@ address and program port:
.TP .TP
\fBhttps\fP \fBhttps\fP
SSL/TLS interception with HTTP protocol decoding, including the removal of SSL/TLS interception with HTTP protocol decoding, including the removal of
HPKP, HSTS and Alternate Protocol response headers. HPKP, HSTS, Upgrade and Alternate Protocol response headers.
This mode currently suppresses WebSockets and HTTP/2.
.TP .TP
\fBpop3s\fP \fBpop3s\fP
SSL/TLS interception with POP3 protocol decoding. SSL/TLS interception with POP3 protocol decoding.
@ -378,7 +393,8 @@ connection content is treated as opaque stream of bytes and not modified.
.TP .TP
\fBhttp\fP \fBhttp\fP
Plain TCP connection without SSL/TLS, with HTTP protocol decoding, including Plain TCP connection without SSL/TLS, with HTTP protocol decoding, including
the removal of HPKP, HSTS and Alternate Protocol response headers. the removal of HPKP, HSTS, Upgrade and Alternate Protocol response headers.
This mode currently suppresses WebSockets and HTTP/2.
.TP .TP
\fBpop3\fP \fBpop3\fP
Plain POP3 connection without SSL/TLS and with POP3 protocol Plain POP3 connection without SSL/TLS and with POP3 protocol

42
sys.c

@ -1,29 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
* Copyright (c) 2017-2018, Soner Tari <sonertari@gmail.com> *
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "sys.h" #include "sys.h"

41
sys.h

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef SYS_H #ifndef SYS_H

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "sys.h" #include "sys.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "thrqueue.h" #include "thrqueue.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef THRQUEUE_H #ifndef THRQUEUE_H

41
url.c

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <stdlib.h> #include <stdlib.h>

41
url.h

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef URL_H #ifndef URL_H

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "url.h" #include "url.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <string.h> #include <string.h>

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef UTIL_H #ifndef UTIL_H

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "util.h" #include "util.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "version.h" #include "version.h"

@ -1,28 +1,29 @@
/* /*-
* SSLsplit - transparent SSL/TLS interception * SSLsplit - transparent SSL/TLS interception
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch> * https://www.roe.ch/SSLsplit
*
* Copyright (c) 2009-2018, Daniel Roethlisberger <daniel@roe.ch>.
* All rights reserved. * All rights reserved.
* http://www.roe.ch/SSLsplit
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions are met:
* are met: * 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright * this list of conditions and the following disclaimer.
* notice, this list of conditions, and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice,
* 2. Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer in the documentation
* notice, this list of conditions and the following disclaimer in the * and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef VERSION_H #ifndef VERSION_H

Loading…
Cancel
Save