├── conf ├── rab.blk ├── dest.blk ├── adminkey.txt ├── mix.cfg ├── header.blk ├── intro.hlp ├── blocked.txt.in ├── dest.alw ├── usage.txt.in ├── reply.txt.in ├── end.hlp ├── mix.hlp ├── mlist.txt ├── news.hlp ├── abuse.txt.in ├── type1.hlp ├── rlist.txt ├── pgp.hlp ├── pgponly.hlp └── mix.cfg.ex ├── debian ├── compat ├── source │ └── format ├── mixmaster.substvars ├── files ├── mixmaster.dirs ├── mixmaster │ ├── usr │ │ └── share │ │ │ └── doc │ │ │ └── mixmaster │ │ │ ├── changelog.gz │ │ │ ├── changelog.Debian.gz │ │ │ └── copyright │ └── DEBIAN │ │ ├── md5sums │ │ └── control ├── NOTES ├── changelog ├── rules ├── mixmaster.prerm ├── mixmaster.postinst ├── control └── copyright ├── Src ├── version.h ├── evp_porting │ ├── INPUT │ ├── MAN │ ├── build.sh │ └── ctr_from_man.c ├── mix.h ├── dummy.c ├── remailer.c ├── dllmain.c ├── tests │ └── test-parse_yearmonthday.c ├── menu.h ├── crypto.h ├── Makefile.deps ├── Makefile.in ├── menuutil.c ├── rndseed.c ├── random.c ├── compress.c ├── mixlib.def ├── pgp.h ├── mpgp.c ├── maildir.c ├── chain1.c └── service.c ├── doc ├── https │ ├── CADIR │ │ ├── 1d63204e.0 │ │ ├── 8f1fe05a.0 │ │ ├── allpingers.net.cert.pem │ │ └── anemone.mooo.com.cert.pem │ ├── firefox_https.png │ ├── curl_with_capath │ └── tips ├── draft-moeller-v2-01.txt ├── sysadmin │ ├── systemd_service │ ├── readme_virtual │ └── xen_deb83_build ├── packet_layout ├── developer_pubkey.asc └── README_302 ├── HISTORY ├── THANKS ├── idea.txt ├── Makefile ├── README.md ├── DebianPackageCommands ├── BUILD.Win32 ├── win32 ├── installer │ └── mixinstall.nsi ├── pcre_chartables.vcproj ├── pcre.vcproj ├── mix.sln ├── mix.vcproj └── zlib.vcproj ├── TODO ├── mpgp.1 ├── COPYRIGHT └── README /conf/rab.blk: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /Src/version.h: -------------------------------------------------------------------------------- 1 | #define VERSION "3.1" 2 | -------------------------------------------------------------------------------- /Src/evp_porting/INPUT: -------------------------------------------------------------------------------- 1 | DEMO text, l>16 qwert 2 | -------------------------------------------------------------------------------- /debian/mixmaster.substvars: -------------------------------------------------------------------------------- 1 | misc:Depends= 2 | -------------------------------------------------------------------------------- /doc/https/CADIR/1d63204e.0: -------------------------------------------------------------------------------- 1 | allpingers.net.cert.pem -------------------------------------------------------------------------------- /doc/https/CADIR/8f1fe05a.0: -------------------------------------------------------------------------------- 1 | anemone.mooo.com.cert.pem -------------------------------------------------------------------------------- /conf/dest.blk: -------------------------------------------------------------------------------- 1 | president@whitehouse.gov 2 | majordomo@ 3 | -------------------------------------------------------------------------------- /debian/files: -------------------------------------------------------------------------------- 1 | mixmaster_3.1-1_amd64.deb misc optional 2 | -------------------------------------------------------------------------------- /conf/adminkey.txt: -------------------------------------------------------------------------------- 1 | Remailer Administrator's key goes here. 2 | -------------------------------------------------------------------------------- /debian/mixmaster.dirs: -------------------------------------------------------------------------------- 1 | usr/bin 2 | var/mixmaster 3 | var/mixkeys 4 | -------------------------------------------------------------------------------- /HISTORY: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merkinmuffley/mixmaster4096/HEAD/HISTORY -------------------------------------------------------------------------------- /THANKS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merkinmuffley/mixmaster4096/HEAD/THANKS -------------------------------------------------------------------------------- /Src/mix.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merkinmuffley/mixmaster4096/HEAD/Src/mix.h -------------------------------------------------------------------------------- /idea.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merkinmuffley/mixmaster4096/HEAD/idea.txt -------------------------------------------------------------------------------- /Src/evp_porting/MAN: -------------------------------------------------------------------------------- 1 | man EVP_aes_128_cfb128 2 | See Also: evp(7), EVP_EncryptInit(3), EVP_CIPHER_meth_new(3) 3 | -------------------------------------------------------------------------------- /doc/draft-moeller-v2-01.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merkinmuffley/mixmaster4096/HEAD/doc/draft-moeller-v2-01.txt -------------------------------------------------------------------------------- /doc/https/firefox_https.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merkinmuffley/mixmaster4096/HEAD/doc/https/firefox_https.png -------------------------------------------------------------------------------- /debian/mixmaster/usr/share/doc/mixmaster/changelog.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merkinmuffley/mixmaster4096/HEAD/debian/mixmaster/usr/share/doc/mixmaster/changelog.gz -------------------------------------------------------------------------------- /debian/NOTES: -------------------------------------------------------------------------------- 1 | mixmaster_3.1.orig.tar.gz 2 | mixmaster_3.1 3 | 4 | https://wiki.debian.org/Packaging/Intro?action=show&redirect=IntroDebianPackaging 5 | 6 | debuild -us -uc 7 | 8 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | mixmaster (3.1-1) UNRELEASED; urgency=medium 2 | 3 | * Initial release. 4 | 5 | -- merkinmuffley Tue, 04 Oct 2016 18:07:29 +0100 6 | -------------------------------------------------------------------------------- /debian/mixmaster/usr/share/doc/mixmaster/changelog.Debian.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/merkinmuffley/mixmaster4096/HEAD/debian/mixmaster/usr/share/doc/mixmaster/changelog.Debian.gz -------------------------------------------------------------------------------- /doc/https/curl_with_capath: -------------------------------------------------------------------------------- 1 | # This is your ~/.curlrc and --capath is described in curl's man page. 2 | # Tested with curl 7.38.0 on Debian 8.3. 3 | --capath /correct-pathname-to/CADIR 4 | -------------------------------------------------------------------------------- /debian/mixmaster/DEBIAN/md5sums: -------------------------------------------------------------------------------- 1 | f0a1550c0746261c217c621fd77fc798 usr/share/doc/mixmaster/changelog.Debian.gz 2 | 86a78780bb086fc9c4d92615be813910 usr/share/doc/mixmaster/changelog.gz 3 | 0179047221ed67cb8c855df9295d4293 usr/share/doc/mixmaster/copyright 4 | -------------------------------------------------------------------------------- /Src/dummy.c: -------------------------------------------------------------------------------- 1 | /* Dummy function for programs that don't use menuutil.c */ 2 | 3 | #include "mix3.h" 4 | 5 | int menu_getuserpass(BUFFER *b, int i) 6 | { 7 | return -1; 8 | } 9 | 10 | void cl(int y, int x) 11 | {} 12 | 13 | int download_stats(char *sourcename) 14 | { 15 | return -1; 16 | } 17 | -------------------------------------------------------------------------------- /conf/mix.cfg: -------------------------------------------------------------------------------- 1 | ######################## Client configuration: ########################## 2 | REMAIL n 3 | 4 | #NAME your realname 5 | #ADDRESS user@host 6 | 7 | SENDPOOLTIME 0h 8 | CHAIN *,*,*,* 9 | NUMCOPIES 1 10 | DISTANCE 2 11 | MINREL 98 12 | RELFINAL 99 13 | MAXLAT 36h 14 | MINLAT 5m 15 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | %: 3 | dh $@ 4 | 5 | build: 6 | echo BUILD 7 | ./DebianConfig 8 | 9 | clean: 10 | echo CLEAN 11 | dh_testdir 12 | dh_testroot 13 | rm -f build-stamp configure-stamp 14 | cd Src && [ -f Makefile ] && $(MAKE) clean || true 15 | dh_clean 16 | 17 | install: 18 | echo NOACTION 19 | -------------------------------------------------------------------------------- /debian/mixmaster/DEBIAN/control: -------------------------------------------------------------------------------- 1 | Package: mixmaster 2 | Version: 3.1-1 3 | Architecture: amd64 4 | Maintainer: Merkin Muffley 5 | Installed-Size: 39 6 | Section: misc 7 | Priority: optional 8 | Homepage: https://github.com/merkinmuffley/mixmaster4096 9 | Description: anonymous mail 10 | both client and server 11 | -------------------------------------------------------------------------------- /debian/mixmaster.prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | systemctl disable mixmaster 5 | 6 | if [ -f /var/mixmaster/mixmaster.pid ] 7 | then 8 | su - mix -c 'kill $(cat /var/mixmaster/mixmaster.pid)' 9 | fi 10 | 11 | if [ -f /var/mixkeys/secring.mix ] 12 | then 13 | dd if=/dev/zero of=/var/mixkeys/secring.mix count=16 14 | rm -f /var/mixkeys/secring.mix 15 | rmdir /var/mixkeys 16 | fi 17 | exit 0 18 | -------------------------------------------------------------------------------- /conf/header.blk: -------------------------------------------------------------------------------- 1 | # Header lines to be filtered out. 2 | 3 | /^From:/ 4 | /^Sender:/ 5 | /^X-Sender:/ 6 | /^Resent-/ 7 | /^Approved:/ 8 | /^Errors-To:/ 9 | /^Message-ID:/ 10 | /^Comments: Authenticated sender is/ 11 | /^Path:/ 12 | /^Received:/ 13 | 14 | /^Control: rmgroup/q 15 | /^Control: newgroup/q 16 | /^Control: sendsys/q 17 | /^Control: checkgroups/q 18 | /^Control: version/q 19 | 20 | # Don't allow excessive crossposting: 21 | /^Newsgroups:.*,.*,.*,.*,.*,/q 22 | 23 | -------------------------------------------------------------------------------- /debian/mixmaster.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | if [ NOUSER = NOUSER$(id -u mix 2>/dev/null) ] 5 | then 6 | useradd -c 'mixmaster remailer' -d /var/mixmaster mix 7 | fi 8 | 9 | if [ ! -d /var/mixkeys ] 10 | then 11 | mkdir /var/mixkeys 12 | fi 13 | chmod go= /var/mixkeys 14 | chown mix /var/mixkeys 15 | 16 | cd /var/mixmaster 17 | perl -pi -e 'my $fqdn=`hostname -f`; chomp($fqdn);s/build\.example\.org/$fqdn/' *.txt mix.cfg 18 | chown mix /var/mixmaster .forward * 19 | 20 | systemctl enable mixmaster 21 | exit 0 22 | -------------------------------------------------------------------------------- /doc/sysadmin/systemd_service: -------------------------------------------------------------------------------- 1 | seen on alt.privacy.anon-server, March 2016, not tested by me yet 2 | 3 | Under systemd, it's very easy to create proper startup scripts. 4 | 5 | This needs to be copied into /etc/systemd/system/mixmaster.service. 6 | 7 | 8 | Description=Mixmaster Anonymous Remailer 9 | After=mail-transport-agent.target 10 | 11 | Type=simple 12 | User=mix 13 | Group=mix 14 | ExecStart=/home/mix/Mix/mixmaster -D 15 | KillMode=process 16 | 17 | WantedBy=multi-user.target 18 | 19 | 20 | # systemctl enable mixmaster 21 | -------------------------------------------------------------------------------- /doc/packet_layout: -------------------------------------------------------------------------------- 1 | The RSA encryption occupies space equal to the modulus which is 2 | from 128 bytes for 1024-bit to 512 bytes for 4096-bit. 3 | 4 | Data encrypted under RSA with the larger keys is (with sizes in bytes): 5 | 24 3deskey (unchanged from older software) 6 | 64 hmac_key for HMAC-SHA256 7 | 32 hmac(2*512 of later header data) to prevent tagging 8 | 32 hmac(body) 9 | 32 hmac(328block) current header data a.k.a TTE standing for three,two,eight 10 | 32 aes_pre_key 11 | 12 | The aes_pre_key is used together with HMAC-SHA256 to generate the 3 13 | AES keys for the body, future headers and the current header data of 14 | size 328. 15 | -------------------------------------------------------------------------------- /conf/intro.hlp: -------------------------------------------------------------------------------- 1 | Subject: Your help request for the %RMN 2 | Reply-To: <%RMA> 3 | 4 | This message is sent to you in response to an email that you sent to 5 | the %RMN. 6 | 7 | This automated reply was triggered by the subject "remailer-help" 8 | contained in your email. If you did not send such an email, please 9 | ignore this message. 10 | 11 | This remailer is a free service that allows individuals including crime 12 | victims, domestic violence victims, persons in recovery, and others, 13 | such as those living under oppressive regimes, to communicate 14 | confidentially in a manner that ensures their privacy under even the 15 | most adverse conditions. 16 | 17 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | install: 2 | install -d debian/var/mixmaster $(DESTDIR)/var/mixmaster 3 | install -d debian/usr/bin $(DESTDIR)/usr/bin 4 | install -d debian/etc/cron.daily $(DESTDIR)/etc/cron.daily 5 | install -d debian/etc/lib/systemd/system $(DESTDIR)/lib/systemd/system 6 | install -m 0644 debian/var/mixmaster/* $(DESTDIR)/var/mixmaster 7 | install debian/usr/bin/mixmaster $(DESTDIR)/usr/bin/ 8 | install debian/usr/bin/mixmaster-getstats $(DESTDIR)/usr/bin/ 9 | install debian/etc/cron.daily/mixmaster $(DESTDIR)/etc/cron.daily 10 | install -m 0644 debian/var/mixmaster/.forward $(DESTDIR)/var/mixmaster 11 | install -m 0644 debian/lib/systemd/system/mixmaster.service $(DESTDIR)/lib/systemd/system 12 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: mixmaster 2 | Maintainer: Merkin Muffley 3 | Homepage: https://github.com/merkinmuffley/mixmaster4096 4 | Section: misc 5 | Priority: optional 6 | Standards-Version: 3.9.6 7 | Build-Depends: build-essential, debhelper (>= 9), openssl (>= 1.0.1), libpcre3-dev, dc, zlib1g (>= 1.2.8), libncurses5-dev, libssl-dev, bison 8 | 9 | Package: mixmaster 10 | Architecture: amd64 11 | Depends: openssl (>= 1.0.1), curl, perl, login, cron, libpcre3, zlib1g, libncurses5, ssl-cert 12 | Description: anonymous mail 13 | program is both client and server 14 | package installs server in /usr/bin 15 | with files in /var/mixmaster 16 | and private keys in /var/mixkeys 17 | -------------------------------------------------------------------------------- /conf/blocked.txt.in: -------------------------------------------------------------------------------- 1 | Subject: %RMN Blocking Confirmation 2 | Reply-To: Abuse Complaint Administrator <%CA> 3 | 4 | Thank you for contacting the Abuse Complaint Administrator of the 5 | %RMN. 6 | The administrator has processed your request to not receive emails from 7 | this anonymous remailer. This remailer will no longer send emails to the 8 | email address(es) for which you requested a block. Note that due to fact 9 | that Internet email can arrive at the destination out-of-sequence, it is 10 | possible, though unlikely, that you may receive emails from this 11 | remailer that were sent prior to your blocking request, but have not yet 12 | been received by you. 13 | 14 | We again wish to apologize for any inconvenience that may have been 15 | caused to you. 16 | 17 | Sincerely, 18 | 19 | -- The %RMN Administrator 20 | 21 | -------------------------------------------------------------------------------- /conf/dest.alw: -------------------------------------------------------------------------------- 1 | ## List of addresses to which Mixmaster will deliver, even in middleman mode 2 | ## Beware: substring matches 3 | 4 | ## 5 | ## allowed destinations 6 | ## 7 | 8 | ## Allows mail to *@example.com 9 | #/@example\.com$/ 10 | 11 | ## Matches *myaddress@example.net* 12 | #myaddress@example.net 13 | 14 | ## Allows direct posts to alt.test and alt.anonymous.messages 15 | ## (only mix posts unless mail2news@ is whitelisted, too) 16 | #/^Newsgroups: +(alt\.test|alt\.anonymous\.messages)$/ 17 | 18 | 19 | ## 20 | ## nymservers 21 | ## 22 | /@nym\.mixmin\.net$/ 23 | /@mixnym\.net$/ 24 | /@is-not-my\.name$/ 25 | /@nymph\.paranoici\.org$/ 26 | /@nymphet\.paranoici\.org$/ 27 | /@nym\.now\.im$/ 28 | 29 | 30 | ## 31 | ## Some (not all) pingers 32 | ## 33 | /^echolot(?:1024)?[+@]/ 34 | /^pinger[+@]/ 35 | /^estragon(?:\+[^@]+)?@frell\.theremailer\.net$/ 36 | /^echolot4\+/ 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Mixmaster is an anonymous remailer first developed in the 1990s by Lance Cottrell. 2 | 3 | Mixmaster 3.1 is a version with 4096 bit RSA Encryption and other features not present before 2013. 4 | 5 | New in version 3.1 is the possibility to make a Debian package, a systemd startup file to run with mixmaster -D and a cron job to update stats and keys from a source (mixmin as default). 6 | 7 | (debian84_mixmaster_3.1-1_amd64.deb) http://www.zen19351.zen.co.uk/mixmaster31/debian84_mixmaster_3.1-1_amd64.deb 8 | 9 | SHA256 cbffa736ac7918bb9d3ebfdf20a7f7ecae0ecc84785a70df535620d8547973fd 10 | 11 | (mixmaster-3.1.tar.gz) http://www.zen19351.zen.co.uk/mixmaster31/mixmaster-3.1.tar.gz 12 | 13 | SHA256 33f12227e867cde1557cd05eab9aad514cc5e2716f0fe6d6f28b67f36f4887a2 14 | 15 | To compile on Red Hat-related systems you may need the pcre-devel package. 16 | 17 | (packet_layout.txt) http://www.zen19351.zen.co.uk/mixmaster31/packet_layout.txt 18 | -------------------------------------------------------------------------------- /Src/remailer.c: -------------------------------------------------------------------------------- 1 | /* Mixmaster version 3.1 -- (C) 1999 - 2016 Anonymizer Inc. and others. 2 | 3 | Mixmaster may be redistributed and modified under certain conditions. 4 | This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 5 | ANY KIND, either express or implied. See the file COPYRIGHT for 6 | details. 7 | 8 | Simple remailer frontend: Read mix packets from standard input. 9 | $Id$ */ 10 | 11 | 12 | #include "mix.h" 13 | #include 14 | 15 | /** main *****************************************************************/ 16 | 17 | /* Returns: 18 | 0 successful operation 19 | 1 error */ 20 | 21 | int main(int argc, char *argv[]) 22 | { 23 | BUFFER *msg; 24 | int ret; 25 | 26 | mix_init(NULL); 27 | msg = buf_new(); 28 | ret = buf_read(msg, stdin); 29 | if (ret != -1) 30 | ret = mix_decrypt(msg); 31 | 32 | mix_regular(0); 33 | mix_exit(); 34 | buf_free(msg); 35 | return (ret == 0 ? 0 : 1); 36 | } 37 | -------------------------------------------------------------------------------- /DebianPackageCommands: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd ~/github_mixmaster || exit 1 4 | [ -d mixmaster4096 ] || exit 1 5 | 6 | # This supposes you run it on your host with the source (need not be debian) 7 | # and it does ssh to the build host (running debian) named "debian84_build" 8 | # (at least in the host file of your source host) and makes the build there. 9 | # This is most convenient using one VM each for build and testing. 10 | 11 | # The build host wants packages (obtained with "apt-get install") 12 | # as listed in "Build-Depends" of debian/control 13 | # as determined with debian 8.4 (minimal install + openssh server) from cd image. 14 | 15 | tar cf - mixmaster4096 | ssh debian84_build 'rm -rf mixmaster* && tar xvf - && rm -rf mixmaster4096/.git && mv -i mixmaster4096 mixmaster_3.1 && tar cvzf mixmaster_3.1.orig.tar.gz mixmaster_3.1 && cd mixmaster_3.1 && export DESTDIR=/tmp/`date +%s` && dpkg-buildpackage -us -uc' 16 | 17 | # Your build host may now have a package. 18 | -------------------------------------------------------------------------------- /conf/usage.txt.in: -------------------------------------------------------------------------------- 1 | Subject: Your email to %RMA 2 | Reply-To: <%RMA> 3 | 4 | This message is being sent to you automatically in response to an email 5 | that you sent to <%RMA>. 6 | If you did not send such an email, please ignore this message. 7 | 8 | This remailer is a free service that allows individuals including crime 9 | victims, domestic violence victims, persons in recovery, and others, 10 | such as those living under oppressive regimes, to communicate 11 | confidentially in a manner that ensures their privacy under even the 12 | most adverse conditions. 13 | 14 | To obtain information on how you can use this service, please send an 15 | email with subject "remailer-help" to <%RMA>. 16 | 17 | Should you have received an unwelcome message through this service or to 18 | report problems with this service, please contact the Administrator at 19 | <%CA>. 20 | 21 | Thank you for your interest in secure and private communications, 22 | 23 | -- The %RMN Administrator 24 | 25 | -------------------------------------------------------------------------------- /Src/dllmain.c: -------------------------------------------------------------------------------- 1 | /* Mixmaster version 3.1 -- (C) 1999 - 2016 Anonymizer Inc. and others. 2 | 3 | Mixmaster may be redistributed and modified under certain conditions. 4 | This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 5 | ANY KIND, either express or implied. See the file COPYRIGHT for 6 | details. 7 | 8 | Mixmaster DLL startup 9 | $Id$ */ 10 | 11 | 12 | #include "mix3.h" 13 | #ifdef WIN32 14 | int WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved) 15 | { 16 | switch (fdwReason) { 17 | case DLL_PROCESS_ATTACH: 18 | if(!is_nt_service()) { 19 | rnd_state = RND_WILLSEED; 20 | mix_init(NULL); 21 | if (rnd_state == RND_WILLSEED) 22 | rnd_state = RND_NOTSEEDED; 23 | } 24 | break; 25 | case DLL_PROCESS_DETACH: 26 | if(!is_nt_service()) 27 | mix_exit(); 28 | break; 29 | case DLL_THREAD_ATTACH: 30 | case DLL_THREAD_DETACH: 31 | return(0); 32 | } 33 | return(1); 34 | } 35 | #endif /* WIN32 */ 36 | -------------------------------------------------------------------------------- /doc/https/tips: -------------------------------------------------------------------------------- 1 | HTTPS can be used to protect the remailer web 2 | traffic that obtains pubkeys and stats. 3 | 4 | Certificates for https are signed statements about a key; 5 | such as what domain name it is for. Make sure the right 6 | CommonName has been used and the cert has not expired. 7 | 8 | Good protocol options and good ciphersuites should 9 | be present. The older bad ones should be avoided 10 | as their presence is often harmful even if you don't 11 | think anyone will use them. Current software versions 12 | are also important and usually fix bugs. 13 | 14 | A browser can show you certificate details of the site 15 | your are viewing (like the png file here where the green 16 | padlock at top-left was clicked on to get the https 17 | connection details). 18 | 19 | Qualys have a free service that will assess a site and 20 | report on problems with the certificate/chain and 21 | protocol versions etc. 22 | 23 | https://www.ssllabs.com/ssltest/ 24 | https://www.ssllabs.com/projects/documentation/ 25 | -------------------------------------------------------------------------------- /doc/sysadmin/readme_virtual: -------------------------------------------------------------------------------- 1 | xen virtualisation notes for debian 2 | 3 | Important lines in a xen definition file such as xen_deb83_build: 4 | - Use hardware virtualisation to get a virtual bios from which you can boot a virtual cdrom. 5 | - Use hda (not xvda) for your disk type for driver support in debian. 6 | 7 | builder = "hvm" 8 | disk = [ '/virt/extloop/mixdeb83_build.img,raw,hda,rw', 9 | '/virt/install_images/debian8.3/debian-8.3.0-amd64-CD-1.iso,raw,hdc:cdrom,r', ] 10 | 11 | 20GB is plenty for a build server, and 10GB for a test server. 12 | Keep a backup so you can easily reinstall the application 13 | on a fresh OS install without needing to perform the OS install again. 14 | 15 | -rw-r--r-- root 21474836480 ... /virt/extloop/mixdeb83_build.img 16 | -rw-r--r-- root 10737418240 ... /virt/extloop/mixdeb83_test.img 17 | -rw-r--r-- root 456279772 ... /virt/extloop/mixdeb83_test.img.BASECOPY.xz 18 | -rw-r--r-- root 657457152 ... /virt/install_images/debian8.3/debian-8.3.0-amd64-CD-1.iso 19 | -------------------------------------------------------------------------------- /BUILD.Win32: -------------------------------------------------------------------------------- 1 | Mixmaster on Windows is known to build with Microsoft Visual Studio .NET 2 | 2003 Professional. 3 | 4 | You will need openssl, zlib, pcre, and pdcurses. 5 | 6 | First, build openssl as described in the openssl documentation. Place 7 | the entire build directory in Src/openssl. 8 | 9 | zlib, pcre, and pdcurses sources are assumed to be in Src/zlib-1.1.4, 10 | Src/pcre-2.08, and Src/pdcurses respectively. 11 | 12 | Open the mixmaster project win32/mix.sln, and build the mix solution. 13 | You should find the results in win32/release. 14 | 15 | 16 | References: 17 | - http://www.openssl.org/ 18 | - http://pdcurses.sourceforge.net/ 19 | 20 | -- 21 | Peter Palfrader, Sat, 1 May 2004 20:31:48 +0200 22 | 23 | 24 | [Note to users of Mixmaster 3.0rc1 and earlier: mix.cfg.txt and pop3.cfg 25 | are now named mix.ini and pop3.ini, respectively, on WIN32. You will 26 | need to manually rename your custom config files, if appropriate.] 27 | 28 | -- 29 | Len Sassaman, Thu, 13 Sep 2007 14:56:37 +0200 30 | 31 | -------------------------------------------------------------------------------- /Src/evp_porting/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cmd_w_mode() 4 | { 5 | mode=$1 6 | case "$mode" in 7 | cbc*) 8 | openssl aes-128-cbc -d -K 000102030405060708090A0B0C0D0E0F -iv 01020304050607080807060504030201 < OUTPUT > RECOVERED_PLAIN 9 | ;; 10 | cfb*) 11 | openssl aes-128-cfb -d -K 000102030405060708090A0B0C0D0E0F -iv 01020304050607080807060504030201 < OUTPUT > RECOVERED_PLAIN 12 | ;; 13 | ctr*) 14 | openssl aes-128-ctr -d -K 000102030405060708090A0B0C0D0E0F -iv 01020304050607080807060504030201 < OUTPUT > RECOVERED_PLAIN 15 | ;; 16 | *) 17 | echo catch-all failure 18 | ;; 19 | esac 20 | } 21 | 22 | 23 | rm -f a.out *.o *.exe OUTPUT NEW_PLAIN RECOVERED_PLAIN 24 | for c in *.c 25 | do 26 | s=$(echo $c | sed 's/.c$//') 27 | gcc -o $s.exe -lcrypto $c 28 | done 29 | 30 | for e in *.exe 31 | do 32 | rm -f OUTPUT NEW_PLAIN RECOVERED_PLAIN 33 | echo testing $e 34 | ./$e \ 35 | && cmd_w_mode $e \ 36 | && cmp INPUT NEW_PLAIN \ 37 | && cmp INPUT RECOVERED_PLAIN \ 38 | && echo test ok on $e 39 | done 40 | -------------------------------------------------------------------------------- /conf/reply.txt.in: -------------------------------------------------------------------------------- 1 | This message is being sent to you automatically in response to an email 2 | that you sent to <%RAA>. 3 | 4 | Most likely, you tried to reply to an email that has been sent through 5 | this service. If you did not send an email to <%RAA>, 6 | please ignore this message. 7 | 8 | The %RMN is a free service that 9 | allows individuals including crime victims, domestic violence victims, 10 | persons in recovery, and others, such as those living under oppressive 11 | regimes, to communicate confidentially in a manner that ensures their 12 | privacy under even the most adverse conditions. 13 | 14 | To block individuals using this remailer from sending email to your 15 | address in the future, please send a message to <%RMA> 16 | containing the line 17 | 18 | DESTINATION-BLOCK 19 | 20 | anywhere in the body text of the email. You can simply forward this 21 | entire email to <%RMA> using your email 22 | program for your current email address to be permanently blocked 23 | from users of the %RMN. 24 | 25 | For more information about the %RMN Administrator's 26 | strict anti-abuse policy, please send a blank email to 27 | <%CA> 28 | 29 | Sincerely, 30 | 31 | -- The %RMN Administrator 32 | 33 | -------------------------------------------------------------------------------- /Src/tests/test-parse_yearmonthday.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #define LINELEN 128 6 | 7 | time_t parse_yearmonthday(char* str) 8 | { 9 | time_t date; 10 | int day, month, year; 11 | 12 | if (sscanf( str, "%d-%d-%d", &year, &month, &day) == 3 ) { 13 | struct tm timestruct; 14 | char *tz; 15 | 16 | tz = getenv("TZ"); 17 | #ifdef HAVE_SETENV 18 | setenv("TZ", "GMT", 1); 19 | #else /* end of HAVE_SETENV */ 20 | putenv("TZ=GMT"); 21 | #endif /* else if not HAVE_SETENV */ 22 | tzset(); 23 | memset(×truct, 0, sizeof(timestruct)); 24 | timestruct.tm_mday = day; 25 | timestruct.tm_mon = month - 1; 26 | timestruct.tm_year = year - 1900; 27 | date = mktime(×truct); 28 | #ifdef HAVE_SETENV 29 | if (tz) 30 | setenv("TZ", tz, 1); 31 | else 32 | unsetenv("TZ"); 33 | #else /* end of HAVE_SETENV */ 34 | if (tz) { 35 | char envstr[LINELEN]; 36 | snprintf(envstr, LINELEN, "TZ=%s", tz); 37 | putenv(envstr); 38 | } else 39 | putenv("TZ="); 40 | #endif /* else if not HAVE_SETENV */ 41 | tzset(); 42 | return date; 43 | } else 44 | return -1; 45 | } 46 | 47 | int main() 48 | { 49 | int t; 50 | 51 | t = parse_yearmonthday("2003-04-02"); 52 | if (t == 1049241600) { 53 | printf("OK.\n"); 54 | exit(0); 55 | } else { 56 | printf("Failed.\n"); 57 | exit(1); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /doc/https/CADIR/allpingers.net.cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDrjCCApYCCQD2xIEnAueuUDANBgkqhkiG9w0BAQUFADCBmDELMAkGA1UEBhMC 3 | VVMxCzAJBgNVBAgMAlRYMRMwEQYDVQQHDApXZXN0IFRleGFzMRcwFQYDVQQKDA5h 4 | bGxwaW5nZXJzLm5ldDEQMA4GA1UECwwHZWNob2xvdDEXMBUGA1UEAwwOYWxscGlu 5 | Z2Vycy5uZXQxIzAhBgkqhkiG9w0BCQEWFGFkbWluQGFsbHBpbmdlcnMubmV0MB4X 6 | DTE2MDMzMTAwMzIyNVoXDTI2MDMyOTAwMzIyNVowgZgxCzAJBgNVBAYTAlVTMQsw 7 | CQYDVQQIDAJUWDETMBEGA1UEBwwKV2VzdCBUZXhhczEXMBUGA1UECgwOYWxscGlu 8 | Z2Vycy5uZXQxEDAOBgNVBAsMB2VjaG9sb3QxFzAVBgNVBAMMDmFsbHBpbmdlcnMu 9 | bmV0MSMwIQYJKoZIhvcNAQkBFhRhZG1pbkBhbGxwaW5nZXJzLm5ldDCCASIwDQYJ 10 | KoZIhvcNAQEBBQADggEPADCCAQoCggEBAOGujzPQCi7wiUFadK/TC8/yHngLCaud 11 | qaL0XxZp7H0eST0zT0nkGsYIhwKn7WcBHh98dFWkhTNpSpLt/+8/2fe6pOT+hF+U 12 | N+Jq3EnsmA10zAfYjxQFcnNA/usORbpQSRR2fLO9nlGBOVwJ72bm7JRRjbnSGUJu 13 | S7OqRoqz8zVuF7cNwswQ26KoNKPmrwQRSdRd+aS0LycOjtMomWz34fPjFGAqBNYd 14 | TrOmOkJlz39Z6bssWdwTRv0sWyhRW25gwcfMxwLP2KnxUtnls0CaGXKpQm32JevL 15 | uPuFkXd2MIRVodPh+G3+0SUIjz9HUKmJ3aKCwr9hT/ekxzKSc69ZensCAwEAATAN 16 | BgkqhkiG9w0BAQUFAAOCAQEACIZOF/WfCGOOULNMx5KJtCWOMxUq5za1RoK08oyK 17 | tE0Oo9RIePfkFxk+YVww/AYPYJz9hPG31QfwC715ARZDLeYGPyGHhNOHef8UrJ01 18 | ZEGwwtQT9SeBqCU97zWglXhtO/xn1AUzyQJzBNxdkxE2n2BD7/zXImXtErxnkwnO 19 | g8Kd6z5YGR/k7ZXWcZOpGuTWQWuMSUxlacx+XlyTU14epZvdLGaLWiZarzdPrKF2 20 | +MwrC+N7urUgWZXrSoRmp6I/Tj8ShS3DkoqRmFg955e+e09L735FCExILqHviB3n 21 | eduh5A9ZssEqs037/voLFimLEngPKbdr9IGgunR9hXhT3A== 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /Src/menu.h: -------------------------------------------------------------------------------- 1 | /* Mixmaster version 3.1 -- (C) 1999 - 2016 Anonymizer Inc. and others. 2 | 3 | Mixmaster may be redistributed and modified under certain conditions. 4 | This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 5 | ANY KIND, either express or implied. See the file COPYRIGHT for 6 | details. 7 | 8 | Menu-based user interface 9 | $Id$ */ 10 | 11 | 12 | #ifndef _MENU_H 13 | #define _MENU_H 14 | #include "mix3.h" 15 | #ifdef USE_NCURSES 16 | #ifdef HAVE_NCURSES_H 17 | #include 18 | #else /* end of HAVE_NCURSES_H */ 19 | #include 20 | #endif /* else if not HAVE_NCURSES_H */ 21 | #endif /* USE_NCURSES */ 22 | 23 | #define NONANON "non-anonymous" 24 | #define ANON "Anonymous" 25 | 26 | void send_message(int type, char *nym, BUFFER *txt); 27 | void read_folder(char command, char *foldername, char *nym); 28 | void menu_init(void); 29 | void menu_exit(void); 30 | 31 | void menu_spawn_editor(char *path, int lineno); 32 | 33 | #ifdef USE_NCURSES 34 | void read_message(BUFFER *message, char *nym); 35 | void menu_nym(char *); 36 | void menu_chain(char *chain, int type, int post); 37 | void cl(int y, int x); 38 | void askfilename(char *fn); 39 | void savemsg(BUFFER *message); 40 | int menu_replychain(int *d, int *l, char *mdest, char *pdest, char *psub, 41 | char *r); 42 | void update_stats(void); 43 | 44 | #endif /* USE_NCURSES */ 45 | 46 | #define maxnym 30 47 | 48 | #endif /* not _MENU_H */ 49 | -------------------------------------------------------------------------------- /Src/crypto.h: -------------------------------------------------------------------------------- 1 | /* Mixmaster version 3.1 -- (C) 1999 - 2016 Anonymizer Inc. and others. 2 | 3 | Mixmaster may be redistributed and modified under certain conditions. 4 | This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 5 | ANY KIND, either express or implied. See the file COPYRIGHT for 6 | details. 7 | 8 | Interface to cryptographic library 9 | $Id$ */ 10 | 11 | 12 | #ifndef _CRYPTO_H 13 | #define _CRYPTO_H 14 | #include "mix3.h" 15 | 16 | #ifdef USE_OPENSSL 17 | #include 18 | #if (OPENSSL_VERSION_NUMBER < 0x0903100) 19 | #error "This version of OpenSSL is not supported. Please get a more current version from http://www.openssl.org" 20 | #endif /* version check */ 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #ifdef USE_IDEA 31 | #include 32 | #endif /* USE_IDEA */ 33 | #ifdef USE_AES 34 | #include 35 | #endif /* USE_AES */ 36 | #include 37 | #include 38 | 39 | typedef RSA PUBKEY; 40 | typedef RSA SECKEY; 41 | 42 | #else /* end of USE_OPENSSL */ 43 | /* #error "No crypto library." */ 44 | typedef void PUBKEY; 45 | typedef void SECKEY; 46 | #endif /* else not USE_OPENSSL */ 47 | 48 | #endif /* ifndef _CRYPTO_H */ 49 | -------------------------------------------------------------------------------- /conf/end.hlp: -------------------------------------------------------------------------------- 1 | Abuse Policy: 2 | 3 | Unfortunately, there will always be a very small percentage of 4 | individuals that choose to abuse the anonymity that this and similar 5 | systems worldwide afford to send otherwise unwelcome email. The 6 | %RMN does not condone such messages, or their content, 7 | in any way. 8 | 9 | Just as the Post Office is unable to prevent abuse of the mail system as 10 | long as there are public mailboxes into which a person can drop a letter 11 | without including a return address, the %RMN cannot preemptively 12 | prevent irresponsible individuals from using this system to send 13 | inappropriate messages. However, unlike the Post Office, this remailer 14 | enables you to assure that you will not be inconvenienced by users of 15 | this remailer in the future. 16 | 17 | To block the users of this remailer from sending email to your address, 18 | please send a message to <%RMA> 19 | containing the line 20 | 21 | DESTINATION-BLOCK 22 | 23 | anywhere in the body text of the email. You can simply reply to this 24 | message using your email program and send back this entire message for 25 | your current email address to be permanently blocked from users of the 26 | %RMN. 27 | 28 | For additional information on this remailer's abuse policy, instructions 29 | on how to block more than one email address, and to reach the 30 | %RMN operator, please send 31 | email to <%CA>. 32 | 33 | Thank you for your interest in secure and private communications, 34 | 35 | -- The %RMN Administrator 36 | 37 | -------------------------------------------------------------------------------- /doc/sysadmin/xen_deb83_build: -------------------------------------------------------------------------------- 1 | # ===================================================================== 2 | # Example HVM guest configuration 3 | # ===================================================================== 4 | # 5 | # This is a fairly minimal example of what is required for an 6 | # HVM guest. For a more complete guide see xl.cfg(5) 7 | 8 | # This configures an HVM rather than PV guest 9 | builder = "hvm" 10 | 11 | # Guest name 12 | name = "deb83_build.hvm" 13 | 14 | # 128-bit UUID for the domain as a hexadecimal number. 15 | # Use "uuidgen" to generate one if required. 16 | # The default behavior is to generate a new UUID each time the guest is started. 17 | #uuid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" 18 | 19 | # Enable Microsoft Hyper-V compatibile paravirtualisation / 20 | # enlightenment interfaces. Turning this on can improve Windows guest 21 | # performance and is therefore recommended 22 | #viridian = 1 23 | 24 | # Initial memory allocation (MB) 25 | memory = 1024 26 | 27 | # Maximum memory (MB) 28 | # If this is greater than `memory' then the slack will start ballooned 29 | # (this assumes guest kernel support for ballooning) 30 | #maxmem = 512 31 | 32 | # Number of VCPUS 33 | vcpus = 2 34 | 35 | # Network devices 36 | # A list of 'vifspec' entries as described in 37 | # docs/misc/xl-network-configuration.markdown 38 | vif = [ '' ] 39 | 40 | # Disk Devices 41 | # A list of `diskspec' entries as described in 42 | # docs/misc/xl-disk-configuration.txt 43 | disk = [ '/virt/extloop/mixdeb83_build.img,raw,hda,rw', 44 | '/virt/install_images/debian8.3/debian-8.3.0-amd64-CD-1.iso,raw,hdc:cdrom,r', ] 45 | 46 | 47 | # Guest VGA console configuration, either SDL or VNC 48 | # sdl = 1 49 | vnc = 1 50 | 51 | # c for boot from local disk 52 | boot="cd" 53 | -------------------------------------------------------------------------------- /doc/developer_pubkey.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v2 3 | 4 | mQElBFrz/F0BCMCflY3qCgEIFjSNsZELrwpIfs3NdlckuORcKbdJrm2CYNcUyGMU 5 | xTJdRkrRQ8xHDtnq+AUq1NDChNZeHrgdg/SYg6T1Uy3y9DM3B43ZPiFtqS1WN04j 6 | HuOY+oBsk4KeQwA8/SO+D70N68hTFm7puKps7Qbkoke0BNnNY7Mrd5MR7jy0cJoQ 7 | 8JYqFZ/NUjDJ7T3iI1t+ImyfzUZWbFLW4FK7Y8Bd0fDZS3bfs9Dt5eKZDmkTDXCd 8 | iQyMyKpw7yWELVH6npA3Moqu6igWENXIT6eW3rmVJ2UyFTg0UZb+ufR95sr8akmf 9 | gqXPnN0o49eqIS43YMGRFKlblbAoOeuCIFQZFEu7N3E2SDGRLllJOOL9NmccFGtH 10 | H4ClABEBAAG0IEVsdmlzIDxtZXJraW5tdWZmbGV5QGdpdGh1Yi5jb20+iQFXBBMB 11 | AgApBQJa8/xdAhsDBQkDwmcABwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQ 12 | j+efuBeXhIMRoQjAmKlTHOT/tEg+HgylVwM6UKF8sv19d39dv+XoAOU+rGeJkIA0 13 | L0zVGBqzAMZkMou7XGIor91trKRbSmcwIA5HQjNaKkMmC/qmpC9kAz00KaGPzJx8 14 | H0U1z1CzH8EpqYeCl25e59w9Afi7dTHrscdMvGcr9zcWpFJVVBIHZsQyCSomuWDt 15 | ytw2K39JYMsGRbkmi1C724hyBX6dXrVaIlftkKdaPAcDqTuBAhNUbZAFiMyZh3RD 16 | mBD8UVIHmpN0AJZqyJguiOjGjk1LACVb9C3dYnAQsSJRrRt9IPRyoXVqotXb5DVX 17 | Okf+/mS4MtInDRhLZMzaEFVcuUwkQzLm75zFpLoVk4F8YwvikfcY7TW+sFYFZqsU 18 | 5mzJK7kBJQRa8/xdAQjA0IGyWNWAeQl3fZmfA6uTubHsMb7pDR4NigwkYwkKsLNP 19 | 3PJV1pJ28Xm9YJbo6Mw2EyjgXo8bDQpbiOp59D9IriAhb5B2zOfrLyGVxzN5Baor 20 | BF96LLEN2dzDqISwMECrTM2PhTEtKCNzbejLlkD0FEdwt3yzeJ4Urh1hyNEBUVCR 21 | 6zV90vBkJrF9Vj5uxyxy3J6eXhpgxfoVwxd/eN8oOLA8/RzDnYywlB8jCHih83+i 22 | 9ZjKN2Dp2QCjl6SKoxc0QI/U7O+TiqdIRCAYx1GzXgIlkXNAaQbhaStDRClUnxqP 23 | eZWcS7lYwBo/T9bl57FG5XdrRwYV/EOTD9oADFutQNd4wP3WY9QpLbSEGflK5xH0 24 | AR5gkQXrbQARAQABiQE9BBgBAgAPBQJa8/xdAhsMBQkDwmcAAAoJEI/nn7gXl4SD 25 | 8esIvRmpo8E+NvRaCsc7AwAgFk9sy4e7TbaD/gY/kMJrx20JbhZ6itghJcs2y74c 26 | vMl0ZPDw8ILUrQG5QtPXIj57p9utcI7u4Ed2YAcTiZPJWrnBkaWjro+PLAuVxa1i 27 | PSAIDWh8oL1YAUUB+WKciEwcZ/c7K/sPa4WaZj/axZR3kp9MtHJThhOV+MCXdHDT 28 | 3oo0wROzYDDlCn57hKtQNJJEABq/+TU5oGulVIQZPrs7rnCx+3SahM5Kf1Jgp19M 29 | pX5JTmeQuGcXYUcLVFDf+tQPkol6dEVDHhznO0+fu5WAMvMqv/89BlJujfwlFIuM 30 | IEHSJd8PbeA33VprD9BEYKggDNKE/YEmqgOXjjqqfhTXbeAi2SsKUtsskkA= 31 | =Ti8w 32 | -----END PGP PUBLIC KEY BLOCK----- 33 | -------------------------------------------------------------------------------- /Src/Makefile.deps: -------------------------------------------------------------------------------- 1 | # Mixmaster version 3.0 -- (C) 1999 - 2006 Anonymizer Inc. and others. 2 | 3 | # Mixmaster may be redistributed and modified under certain conditions. 4 | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 5 | # ANY KIND, either express or implied. See the file COPYRIGHT for 6 | # details. 7 | 8 | # $Id: $ 9 | 10 | buffers.o: mix3.h config.h version.h mix.h 11 | chain.o: mix3.h config.h version.h mix.h 12 | chain1.o: mix3.h config.h version.h mix.h pgp.h 13 | chain2.o: mix3.h config.h version.h mix.h 14 | chain3.o: mix3.h config.h version.h mix.h 15 | compress.o: mix3.h config.h version.h mix.h 16 | crypto.o: mix3.h config.h version.h mix.h crypto.h 17 | dllmain.o: mix3.h config.h version.h mix.h 18 | dummy.o: mix3.h config.h version.h mix.h 19 | keymgt.o: mix3.h config.h version.h mix.h 20 | mail.o: mix3.h config.h version.h mix.h 21 | maildir.o: mix3.h config.h version.h mix.h 22 | main.o: mix3.h config.h version.h mix.h 23 | menu.o: menu.h mix3.h config.h version.h mix.h 24 | menunym.o: menu.h mix3.h config.h version.h mix.h 25 | menusend.o: menu.h mix3.h config.h version.h mix.h 26 | menuutil.o: menu.h mix3.h config.h version.h mix.h 27 | mime.o: mix3.h config.h version.h mix.h 28 | mix.o: mix3.h config.h version.h mix.h menu.h 29 | nym.o: mix3.h config.h version.h mix.h pgp.h 30 | pgp.o: mix3.h config.h version.h mix.h pgp.h 31 | pgpcreat.o: mix3.h config.h version.h mix.h pgp.h crypto.h 32 | pgpdata.o: mix3.h config.h version.h mix.h pgp.h crypto.h 33 | pgpdb.o: mix3.h config.h version.h mix.h pgp.h 34 | pgpget.o: mix3.h config.h version.h mix.h pgp.h crypto.h 35 | mpgp.o: mix3.h config.h version.h mix.h pgp.h 36 | pool.o: mix3.h config.h version.h mix.h 37 | random.o: mix3.h config.h version.h mix.h crypto.h 38 | rem.o: mix3.h config.h version.h mix.h 39 | rem1.o: mix3.h config.h version.h mix.h 40 | rem2.o: mix3.h config.h version.h mix.h 41 | rem3.o: mix3.h config.h version.h mix.h 42 | remailer.o: mix.h 43 | rfc822.o: mix3.h config.h version.h mix.h 44 | rndseed.o: mix3.h config.h version.h mix.h 45 | stats.o: mix3.h config.h version.h mix.h 46 | util.o: mix3.h config.h version.h mix.h 47 | -------------------------------------------------------------------------------- /doc/https/CADIR/anemone.mooo.com.cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIFkzCCA3ugAwIBAgIJAL3AYeJWe9WeMA0GCSqGSIb3DQEBCwUAMGAxCzAJBgNV 3 | BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX 4 | aWRnaXRzIFB0eSBMdGQxGTAXBgNVBAMMEGFuZW1vbmUubW9vby5jb20wHhcNMTYw 5 | MzA4MTg0OTMxWhcNMTgwNTE3MTg0OTMxWjBgMQswCQYDVQQGEwJBVTETMBEGA1UE 6 | CAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRk 7 | MRkwFwYDVQQDDBBhbmVtb25lLm1vb28uY29tMIICIjANBgkqhkiG9w0BAQEFAAOC 8 | Ag8AMIICCgKCAgEAtI1auyiC7wl3PYy6j/G9PJ46LCPtqKmy20gr97L+wItgGgKf 9 | HJPRPMV6CKtKS8hHzLkqejgt5S5+d9Dr1+CuUY6PFkowPxDe6Ks/hCPZWewfjrVY 10 | TqJyxeNQLoQGpJd2oIVlCL7MFB6ne/2dS38qLWveTh7Ex1VPj9f+3nZBSpbqOSUj 11 | KaeIgVNpacxqDpefDKOfNC/nnvJNvKUUba9lInKsQmUBPDGqihSqYKR/Y56byoyP 12 | RL3YbPvbo4EisDUishqFaAwAikoTdLtJ0TMpDQrCeCkJdYnEqyzYNGBK+x2NNsvV 13 | rzyWOAN6PlhJVtwWlo5i+sA0S2hkzB+fVcwyX8S6b71Dnh9UAXh+ZP7OXfH9uTmw 14 | JMdfjL8ji8SpxJ2xG3d7b3j+BvxNRaxLZ9vp1dy1ExS699XhS6rKaTAfuks9DiRw 15 | FztDdAEkEWGl6MR4AhRp9sKv6q6PsSsms6OHSY7SPXRAvuR7Yq432OBnFe6iwx9Q 16 | BRlY8IcgTDLiZBe4MoLF/dOCEGWUIZtYND0DJpCSXI8jdBPeq2DeSr0bgqedR0bW 17 | A2+MxuS58DcCV65NLx6h2+TLj60XhsTv/ann0xQsRfnF4DM/YZmwEHVRy259JIuJ 18 | 1JHDzBHlBI5ifKlxjNdv0PcYKqiZPKwf6vqi40ZbElooJO5tpcyAZ7LmEV8CAwEA 19 | AaNQME4wHQYDVR0OBBYEFCRnsOT9Lj4GTNvj2AS94l1s6VDtMB8GA1UdIwQYMBaA 20 | FCRnsOT9Lj4GTNvj2AS94l1s6VDtMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEL 21 | BQADggIBAGzu0BlrvqjfBgQY+UOILOWuwM7eLvpnTfpGYILb+5dQncMtX/k09RaU 22 | 9lP8YjyoDh3vzHUOPvhUEoouBUEIhuVMiEir9y+4Nj4ZfnYxDz8/IfE6F1AxDQsl 23 | a1XSWaULjOMrRCRPZMpbLvMT/craScwngwM55kusbHH9aq0cZrJgLY6RTqAlNA4R 24 | rDEPiC5IZjDxbLLTzjtSKll3oEMJeYxfh6NtbgBrSBamWzn5s4HEV/EbaoTH4v0k 25 | B0gufaE/Ib7uhNrRXCMX2r3l7R71FSFxRXyc92zzAsJxTctbC9KGEfBmFEkIrZrN 26 | Al6SINOOc4J1oYPJF8hk5LhaO3F7tUWsv1xbCFATS/QWtVz7Ffm3BWR2814jggcD 27 | tVCZ1dVmI5CBW/qtZsp/UWifXwA+mo5j475IJT4QrprfoPx7ve1M0SAdPbJJCmCE 28 | 5YbWsrrWV0JTmbdkBv6M3s4fi0h8sqa0eqA3iCjjya3iBvBiaEkfb4/vHXv8Sfmv 29 | H+rFacHzrnaa32wUF5V8WIzGl83JoWTwlrpFtzrk77lcQ1Ek7wfCWu+QCsg+tXd6 30 | uF6AwWUYhaIwVpbvMDmN+PtZ2f4a5PW1fdBsbhh96RnRT9qDnHXAryz/ATWVS44s 31 | SBNczFnenIg6nqoTr+CRnEEMrxWfcTng/U0cuRMA88kmdZYEkw3h 32 | -----END CERTIFICATE----- 33 | -------------------------------------------------------------------------------- /Src/evp_porting/ctr_from_man.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | /* adapted from "man EVP_EncryptInit" */ 8 | 9 | int do_crypt(FILE *in, FILE *out, int do_encrypt) 10 | { 11 | /* Allow enough space in output buffer for additional block */ 12 | unsigned char inbuf[1024], outbuf[1024 + EVP_MAX_BLOCK_LENGTH]; 13 | int inlen, outlen; 14 | EVP_CIPHER_CTX *ctx; 15 | /* 16 | * Bogus key and IV: we'd normally set these from 17 | * another source. 18 | */ 19 | unsigned char key[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; 20 | unsigned char iv[] = {1,2,3,4,5,6,7,8, 8,7,6,5,4,3,2,1}; 21 | 22 | 23 | /* Don't set key or IV right away; we want to check lengths */ 24 | ctx = EVP_CIPHER_CTX_new(); 25 | EVP_CipherInit_ex(ctx, EVP_aes_128_ctr(), NULL, NULL, NULL, 26 | do_encrypt); 27 | OPENSSL_assert(EVP_CIPHER_CTX_key_length(ctx) == 16); 28 | OPENSSL_assert(EVP_CIPHER_CTX_iv_length(ctx) == 16); 29 | 30 | /* Now we can set key and IV */ 31 | EVP_CipherInit_ex(ctx, NULL, NULL, key, iv, do_encrypt); 32 | 33 | for (;;) { 34 | inlen = fread(inbuf, 1, 1024, in); 35 | if (inlen <= 0) 36 | break; 37 | if (!EVP_CipherUpdate(ctx, outbuf, &outlen, inbuf, inlen)) { 38 | /* Error */ 39 | EVP_CIPHER_CTX_free(ctx); 40 | return 0; 41 | } 42 | fwrite(outbuf, 1, outlen, out); 43 | } 44 | if (!EVP_CipherFinal_ex(ctx, outbuf, &outlen)) { 45 | /* Error */ 46 | EVP_CIPHER_CTX_free(ctx); 47 | return 0; 48 | } 49 | fwrite(outbuf, 1, outlen, out); 50 | 51 | EVP_CIPHER_CTX_free(ctx); 52 | return 1; 53 | } 54 | 55 | 56 | int main(int argc, char *argv[]) { 57 | FILE *infile, *outfile; 58 | 59 | infile = fopen("INPUT", "r"); 60 | outfile = fopen("OUTPUT", "w"); 61 | if (1 != do_crypt(infile, outfile, 1)) { 62 | exit(2); 63 | } 64 | fclose(infile); 65 | fclose(outfile); 66 | 67 | /* and test it */ 68 | 69 | infile = fopen("OUTPUT", "r"); 70 | outfile = fopen("NEW_PLAIN", "w"); 71 | if (1 != do_crypt(infile, outfile, 0)) { 72 | exit(2); 73 | } 74 | fclose(infile); 75 | fclose(outfile); 76 | 77 | exit(0); 78 | } 79 | -------------------------------------------------------------------------------- /conf/mix.hlp: -------------------------------------------------------------------------------- 1 | This independent remailer uses the Mixmaster remailer software. It is 2 | highly recommended that you obtain a copy of the Mixmaster software to 3 | utilize this remailer. This particular remailer may offer other means of 4 | accessing the remailer service. If this remailer offers other means of 5 | accessing the remailer service, the means will be described later in 6 | this help file. However, only by using the Mixmaster client software 7 | will you assure the highest level of security against third-parties 8 | compromising your privacy. How to obtain the Mixmaster software: 9 | 10 | Mixmaster source code for FreeBSD, Linux, other variants of UNIX, and 11 | Win32: 12 | 13 | The first version of Mixmaster to allow RSA keys of 4096 bits 14 | is at http://www.zen19351.zen.co.uk/mixmaster302/ 15 | and without this feature your chains will not be able to use 16 | remailers with large keys. Keys of 1024 bits are less secure and 17 | there has been discussion about ending their use. 18 | 19 | If your operating system is a UNIX derivative, simply download and 20 | compile the client from the source code available at 21 | http://prdownloads.sourceforge.net/mixmaster/ 22 | 23 | Mixmaster clients binaries for Win32 (Windows 98, NT, 2000, XP) 24 | 25 | Win32 users may wish to try one of the GUI applications that interface with 26 | Mixmaster: 27 | Omnimix: http://www.danner-net.de/om.htm 28 | Quicksilver: http://www.quicksilvermail.net/ 29 | Jack B. Nymble: http://www.panta-rhei.eu.org/downloads/JBN/ 30 | These are all developed independently of the main Mixmaster distribution. Please 31 | do not contact the Mixmaster development team or the Administrator of the 32 | %RMN with questions about this software. 33 | 34 | For more information about Mixmaster or to contribute to the development 35 | of Mixmaster, please see the following URL's: 36 | 37 | Official Mixmaster Project Site: 38 | http://sourceforge.net/projects/mixmaster/ 39 | The mailing list there is still usable although the rest of the project is neglected. 40 | 41 | General Information about Remailers and Remailer "how-to" Guides: 42 | http://www.noreply.org/ 43 | http://www.faqs.org/faqs/privacy/anon-server/ 44 | http://www.andrebacard.com/remail.html 45 | http://www.freehaven.net/ 46 | http://www.stack.nl/~galactus/remailers/ 47 | 48 | Remailer Meta-Statistics: 49 | http://stats.mixmin.net 50 | 51 | **** 52 | 53 | -------------------------------------------------------------------------------- /conf/mlist.txt: -------------------------------------------------------------------------------- 1 | 2 | Groups of remailers sharing a machine or operator: 3 | (banana hsub slow) 4 | 5 | 6 | Broken type-I remailer chains: 7 | (* senshi) 8 | (3nails dizum) 9 | (3nails slug) 10 | (anon slug) 11 | (dizum hermetix) 12 | (frell dizum) 13 | (frell slug) 14 | (raspberry hsub) 15 | (slug anon) 16 | (slug austria) 17 | 18 | Broken type-II remailer chains: 19 | (3nails bunker) 20 | (3nails dizum) 21 | (austria bunker) 22 | (devurandom slug) 23 | (eurovibes bunker) 24 | (fotonl1 bunker) 25 | (fotonl1 slug) 26 | (freierede slug) 27 | (frell bunker) 28 | (frell dizum) 29 | (hermetix slug) 30 | (kreti slug) 31 | (kroken bunker) 32 | (kroken slug) 33 | (lulunga slug) 34 | (paranoia slug) 35 | (pobox slug) 36 | (rabbi bunker) 37 | (raspberry bunker) 38 | (raspberry slug) 39 | (slow bunker) 40 | (slug austria) 41 | (slug awxcnx) 42 | (slug bunker) 43 | (slug dizum) 44 | (slug fotonl1) 45 | (slug hermetix) 46 | (slug lulunga) 47 | (slug pobox) 48 | Last update: Fri 30 Nov 2012 10:20:00 GMT 49 | mixmaster history latency uptime 50 | -------------------------------------------- 51 | anon ************ 25:00 100.00% 52 | austria ************ 29:59 100.00% 53 | banana ************ 21:00 100.00% 54 | breaka ************ 22:00 100.00% 55 | cmeclax *+++++++++++ 1:15:59 100.00% 56 | devurandom ************ 21:30 100.00% 57 | dizum ************ 21:00 100.00% 58 | fotonl1 ************ 27:00 100.00% 59 | fotoro1 ************ 26:00 100.00% 60 | hermetix ++++++++++++ 1:39:00 100.00% 61 | paranoia ************ 25:30 100.00% 62 | eurovibes ++++++++++++ 1:40:00 99.91% 63 | lulunga ++++++++++++ 1:33:00 99.88% 64 | awxcnx ++++++++++++ 1:28:00 99.78% 65 | rabbi ++++++++++++ 1:30:00 99.76% 66 | raspberry ************ 12:00 99.51% 67 | kroken *+++**+++++* 1:02:00 99.51% 68 | cripto ************ 28:00 99.46% 69 | frell -+---------+ 5:10:30 99.30% 70 | 3nails ++*+-+++-+++ 1:35:30 98.89% 71 | freierede ++++++++++++ 1:19:00 97.78% 72 | kreti +*+**+++*++* 1:10:00 96.91% 73 | slow -----------+ 16:49:59 94.49% 74 | winters +++++*++++++ 1:30:00 92.40% 75 | pobox ++++++++++++ 1:28:00 91.97% 76 | slug ******** 16:00 49.32% 77 | bunker +-++ ++- 1:51:29 7.08% 78 | -------------------------------------------------------------------------------- /conf/news.hlp: -------------------------------------------------------------------------------- 1 | You can use this remailer to post messages to Usenet newsgroups. To send 2 | a message to Usenet, insert the "Anon-post-to:" header as per the 3 | examples below. 4 | 5 | ================================================================== 6 | To: %RMA 7 | 8 | :: 9 | Anon-Post-To: alt.test,misc.test 10 | 11 | ## 12 | Subject: An Anonymous Usenet Post 13 | 14 | This message is anonymous. 15 | =================================================================== 16 | When posting test messages, please use the appropriate test newsgroups such 17 | as alt.test and misc.test. 18 | 19 | The newsgroup alt.privacy.anon-server is not a test newsgroup. Please do 20 | not use alt.privacy.anon-server for testing purposes. 21 | 22 | To post a follow-up to a Usenet article, you must insert a "References:" 23 | header. 24 | 25 | Here is an example as to how to reply to a message that originally 26 | contained the following headers: 27 | 28 | ================================================================== 29 | Newsgroups: soc.rights.human 30 | Subject: Re: Are you a witness of torture in West Africa? 31 | Message-ID: <6643215551.110344173@news.newssender_domain.com> 32 | References: <19990101182004.17714.qmail@nym.some_nymserver.com> 33 | ================================================================== 34 | 35 | Your anonymous follow-up message should begin as follows. Note the 36 | required blank line between the "To:" header and the double colon. 37 | 38 | ================================================================== 39 | To %RMA 40 | 41 | :: 42 | Anon-Post-To: soc.rights.human 43 | 44 | ## 45 | Subject: RE: Are you a witness of torture in West Africa? 46 | References: 19990101182004.17714.qmail@nym.some_nymserver.com 47 | 48 | Two weeks ago, soldiers came to our village. The soldiers all had 49 | machine guns. Nobody in our village has any guns, since the police had 50 | come by our village about a year ago and took away all of our guns to 51 | protect us from bandits. There was nothing we could do to resist the 52 | soldiers. The soldiers rounded up all the men, except young children and 53 | the very old. Then the soldiers lead the men away from the village. 54 | About half an hour later, we heard many shots in the distance. When we 55 | went looking for our people, all men were dead. The soldiers had left. 56 | The next day, they went to another village in the [. . .] 57 | ================================================================== 58 | ***** 59 | 60 | -------------------------------------------------------------------------------- /win32/installer/mixinstall.nsi: -------------------------------------------------------------------------------- 1 | Name "Mixmaster" 2 | 3 | OutFile "Mixmaster-Setup.exe" 4 | 5 | InstallDir $PROGRAMFILES\Mixmaster 6 | 7 | ; Registry key to check for directory (so if you install again, it will 8 | ; overwrite the old one automatically) 9 | InstallDirRegKey HKLM "Software\Mixmaster" "Install_Dir" 10 | 11 | ;-------------------------------- 12 | 13 | ; Pages 14 | 15 | Page components 16 | Page directory 17 | Page instfiles 18 | 19 | UninstPage uninstConfirm 20 | UninstPage instfiles 21 | 22 | ;-------------------------------- 23 | 24 | Section "Mixmaster" 25 | SectionIn RO 26 | SetOutPath $INSTDIR 27 | File "..\release\mix.exe" 28 | File "..\release\mixlib.dll" 29 | File "..\..\Src\openssl\out32dll\libeay32.dll" 30 | File "c:\winnt\system32\msvcr71.dll" 31 | 32 | WriteRegStr HKLM SOFTWARE\Mixmaster "Install_Dir" "$INSTDIR" 33 | 34 | ; Write the uninstall keys for Windows 35 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mixmaster" "DisplayName" "Mixmaster" 36 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mixmaster" "UninstallString" '"$INSTDIR\uninstall.exe"' 37 | WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mixmaster" "NoModify" 1 38 | WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mixmaster" "NoRepair" 1 39 | WriteUninstaller "uninstall.exe" 40 | SectionEnd 41 | 42 | Section "Start Menu Shortcuts (All Users)" 43 | SetShellVarContext all 44 | CreateDirectory "$SMPROGRAMS\Mixmaster" 45 | CreateShortCut "$SMPROGRAMS\Mixmaster\Mixmaster.lnk" "$INSTDIR\mix.exe" "" "$INSTDIR\mix.exe" 0 46 | CreateShortCut "$SMPROGRAMS\Mixmaster\Uninstall Mixmaster.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 47 | SectionEnd 48 | 49 | Section "Create Desktop Item (All Users)" 50 | SetShellVarContext all 51 | CreateShortCut "$DESKTOP\Mixmaster.lnk" "$INSTDIR\mix.exe" "" "$INSTDIR\mix.exe" 0 52 | SectionEnd 53 | 54 | Section "Uninstall" 55 | DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mixmaster" 56 | DeleteRegKey HKLM SOFTWARE\Mixmaster 57 | 58 | Delete $INSTDIR\mix.exe 59 | Delete $INSTDIR\mixlib.dll 60 | Delete $INSTDIR\libeay32.dll 61 | Delete $INSTDIR\msvcr71.dll 62 | Delete $INSTDIR\uninstall.exe 63 | 64 | SetShellVarContext all 65 | Delete "$SMPROGRAMS\Mixmaster\*.*" 66 | RMDir "$SMPROGRAMS\Mixmaster" 67 | Delete "$DESKTOP\Mixmaster.lnk" 68 | 69 | RMDir "$INSTDIR" 70 | SectionEnd 71 | -------------------------------------------------------------------------------- /doc/README_302: -------------------------------------------------------------------------------- 1 | Mixmaster has long used 1024-bit RSA with a packet format that allows 2 | a maximum of 20 hops; each encrypted with a different RSA key. The 3 | data for each hop occupies 512 bytes. 4 | 5 | Given the declining protection offered by a key size from the 1990s I 6 | decided to investigate adapting mixmaster to use 2048-bit keys (each 7 | in a larger header block) at a cost of reducing the longest chain to 8 | 10 hops. 9 | 10 | It turned out possible to exceed this goal. By using a header of 11 | 1024 bytes (max 10 hops) new code can use key sizes of 2048, 3072 12 | and 4096 for RSA. E.g. 10 hops of 4096; or 2 of 1024 and 9 of 4096. 13 | (Key generation might be "mixmaster -G --size=4096 --lifetime=90".) 14 | The default size in the new code is 4096 bits. 15 | 16 | The RSA encryption transferred a 3DES key of 24 bytes and otherwise 17 | contained a lot of free space. Taking advantage of this space to 18 | transfer extra data without growing the packets enabled further progress. 19 | 20 | When using the larger RSA keys (2048 and up) the symmetric crypto of 21 | 3DES CBC is augmented by adding AES-256 CFB on top of it. And three 22 | parts of the data are covered by HMAC-SHA256 (in the order encrypt then MAC). 23 | - the body which previously had no protection 24 | - the current header block which had only MD5 25 | - the next header block to prevent a tagging attack (see footnotes) 26 | When using 1024-bit RSA these new features are not used so as to keep 27 | compatibility with older software. 28 | 29 | Stats are kept of the RSA key sizes used to help operators monitor uptake of 30 | larger keys and assess when 1024-bit keys can be discontinued. 31 | 32 | Actions: 33 | 1. To review and discuss the code please use Mixmaster-devel@lists.sourceforge.net 34 | (still a useful place to hold discussion although the SF maintainers are inactive ). 35 | 2. To discuss testing and deployment use Remops@lists.mixmin.net (it would be helpful 36 | to have some short-term test remailers even if they were not to remain long term.) 37 | Some traffic may be relevant on both those lists and maybe also cryptography@metzdowd.com . 38 | 3. Development of a more advanced remailer needs a lead maintainer: 39 | mixminion-dev@seul.org 40 | http://mixminion.net/ 41 | https://github.com/nmathewson/mixminion 42 | 43 | Code location: 44 | http://www.zen19351.zen.co.uk/mixmaster302/ 45 | 46 | Further reading: 47 | http://www.freehaven.net/anonbib/cache/mixmaster-spec.txt 48 | https://crypto.is/blog/packet_formats_1 49 | https://crypto.is/blog/tagging_attack_on_mixmaster 50 | http://www.nsa.gov/business/programs/elliptic_curve.shtml 51 | -------------------------------------------------------------------------------- /Src/Makefile.in: -------------------------------------------------------------------------------- 1 | # Mixmaster version 3.0 -- (C) 1999 - 2006 Anonymizer Inc. and others. 2 | 3 | # Mixmaster may be redistributed and modified under certain conditions. 4 | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 5 | # ANY KIND, either express or implied. See the file COPYRIGHT for 6 | # details. 7 | 8 | # $Id: Makefile.in 647 2003-10-25 23:34:13Z weasel $ 9 | 10 | # Edit according to the libraries you want to use: 11 | INC = %INC 12 | DEF = %DEF -DUSE_SOCK %MIXDIR 13 | LIBS = %LIBS 14 | LDFLAGS = %LDFLAGS 15 | 16 | # Set compiler options 17 | # Note: Define NDEBUG to disable "assert" when not using DEBUG 18 | 19 | OPT = -g -Wall -DNDEBUG 20 | # OPT = -g -pg -Wall -DDEBUG 21 | # OPT = -O2 -Wall -DNDEBUG 22 | 23 | CFLAGS = $(INC) $(DEF) $(OPT) 24 | CC = gcc 25 | AR = ar rc 26 | RANLIB = ranlib 27 | #MAKE = make 28 | 29 | OBJ = mix.o rem.o rem1.o rem2.o chain.o chain1.o chain2.o nym.o pgp.o pgpdb.o pgpdata.o pgpget.o pgpcreat.o pool.o mail.o rfc822.o mime.o keymgt.o compress.o stats.o crypto.o random.o util.o buffers.o maildir.o parsedate.tab.o 30 | 31 | MIXOBJ = rndseed.o menu.o menusend.o menunym.o menuutil.o menustats.o 32 | NOMENUOBJ = rndseed.o dummy.o 33 | WINOBJ = winmain.o winutil.o 34 | 35 | all: mixmaster 36 | 37 | mixmaster: $(OBJ) $(MIXOBJ) main.o $(LIBS) 38 | $(CC) $(OBJ) $(MIXOBJ) main.o $(LIBS) $(LDFLAGS) -o mixmaster 39 | 40 | libmix.a: $(OBJ) $(MIXOBJ) dllmain.o 41 | $(AR) libmix.a $(OBJ) $(MIXOBJ) dllmain.o 42 | 43 | libmix32.a: libmix.a mixlib.def 44 | dllwrap --dllname mixlib.dll --def mixlib.def --output-lib libmix32.a libmix.a zlib-1.1.4/libz.a pcre-2.08/libpcre.a openssl/libeay32.a -lwsock32 45 | 46 | dllmix: main.o libmix32.a 47 | $(CC) main.o libmix32.a -o dllmix 48 | 49 | winmix.exe: $(WINOBJ) libmix32.a 50 | $(CC) $(WINOBJ) libmix32.a -lgdi32 -luser32 $(LDFLAGS) -o mixmaster.exe 51 | 52 | winmix: winmenu.res #winmix.exe 53 | rsrc winmenu.res mixmaster.exe 54 | 55 | winmenu.o: winmenu.rc winmenu.h 56 | windres winmenu.rc winmenu.o 57 | 58 | remailer: $(OBJ) $(NOMENUOBJ) remailer.o $(LIBS) 59 | $(CC) $(OBJ) $(NOMENUOBJ) remailer.o $(LIBS) $(LDFLAGS) -o remailer 60 | 61 | mpgp: $(OBJ) $(NOMENUOBJ) mpgp.o $(LIBS) 62 | $(CC) $(OBJ) $(NOMENUOBJ) mpgp.o $(LIBS) $(LDFLAGS) -o mpgp 63 | 64 | test: $(OBJ) test.o $(NOMENUOBJ) $(LIBS) 65 | $(CC) $(OBJ) test.o $(NOMENUOBJ) $(LIBS) $(LDFLAGS) -o test 66 | 67 | clean: 68 | -rm -f *.o *.a *.res *~ mixmaster mix *.exe remailer test mpgp core gmon.out 69 | 70 | allclean: clean 71 | -rm -f Makefile 72 | 73 | distclean: allclean 74 | 75 | ci: clean 76 | cd ~/src/mix3; ci -l * Mix/* Mix/Src/*; echo 77 | 78 | parsedate.tab.c: parsedate.y 79 | @echo Expect 6 shift/reduce conflicts 80 | bison parsedate.y 81 | 82 | parsedate: parsedate.tab.c 83 | gcc -DTEST parsedate.tab.c -o parsedate 84 | 85 | install: debian/usr/bin/mixmaster 86 | echo TRYING INSTALL debian/usr/bin/mixmaster to /usr/bin/mixmaster 87 | install debian/usr/bin/mixmaster /usr/bin/ 88 | 89 | include Makefile.deps 90 | -------------------------------------------------------------------------------- /win32/pcre_chartables.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 11 | 12 | 13 | 21 | 35 | 37 | 44 | 48 | 52 | 54 | 56 | 60 | 62 | 64 | 66 | 68 | 70 | 71 | 72 | 73 | 74 | 75 | 78 | 80 | 82 | 86 | 87 | 88 | 89 | 92 | 93 | 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /win32/pcre.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 11 | 12 | 13 | 21 | 35 | 37 | 41 | 43 | 45 | 47 | 49 | 53 | 55 | 57 | 59 | 61 | 62 | 63 | 64 | 65 | 66 | 69 | 71 | 73 | 77 | 78 | 79 | 81 | 83 | 87 | 88 | 89 | 91 | 93 | 97 | 98 | 99 | 101 | 103 | 107 | 108 | 109 | 110 | 113 | 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | Items that need to be completed before the next MAIN release: 2 | 3 | - revert renaming of conf files for WIN32. 4 | - Fix Solaris 10 Install bug (whoami is located in /usr/ucb/ ) 5 | 6 | Items to watch: 7 | 8 | - Hunt and kill bug in Mixmaster causing echolot pings to be turned 9 | into permanent t* files. 10 | [This is a pesky one. Changing the .forward pipe to go through 11 | truss first 'fixes' it. Grr. --rabbi] 12 | 13 | Items for 3.0.x: 14 | - doallow() should check more than one email address in a line 15 | - Automatically fetch pinger list and stats during installation process 16 | - destblk request confirmation (patch # 873498) 17 | + perhaps we should phase this out in favor of a distributed RAB? 18 | - general bug fixes that do not break backward compatibility 19 | - Fix the randomness/entropy gathering 20 | - Make mixmaster do nothing but report version when run with -V 21 | 22 | Items for 3.1.x 23 | - Full WIN32 support. 24 | - Sane randomness handling 25 | - Resolve crash when running with --post 26 | - Resolve crash when config contains "SENDMAIL outfile" 27 | - Confirm operation as a WIN32 service 28 | - Test on Vista. 29 | - Make Win32 Mixmaster portable. i.e. Don't require a CSIDL_APPDATA dir, 30 | just use the current one. 31 | - Include a formal win32 binary release, complete with docs. 32 | - Integrate RAB support -- automatic downloading similar to stats. 33 | - Introduce hashed RAB handling where mail recipients are hashed and 34 | compared against a downloaded rab.hash file. This solves the issue 35 | of publishing a plain-text list of email addresses. 36 | + We might want to salt these hashes but the salt would have to be 37 | known to remops. 38 | - Hashcash support? 39 | 40 | Items for 3.5: 41 | 42 | - binomial mix implementation 43 | - RGB dummies 44 | - native echolot 45 | - Regroup-and-Go? 46 | 47 | Packaging: 48 | - Modify release tarball generation script to build the .tab.c file from 49 | parsedate.y, so we don't end up requiring bison on every system that 50 | wants to build mixmaster (rabbi) 51 | - rpm -- dybbuk 52 | - Windows build instructions/files (zax) 53 | - provide a packaged Windows build to be used with QuickSilver 54 | - Macintosh OS/X support (rabbi) 55 | - Update Install script to put files in global system locations if 56 | invoked by root. Also update to be smart about AES support. 57 | (dybbuk said he would do this, but status is unclear.) 58 | 59 | Wishlist: 60 | - permit CRAM-MD5 SMTP AUTH in addition to LOGIN. n/a (patch welcome) 61 | - do full regression tests on as many platforms possible 62 | - list only these platforms as supported 63 | - test on Solaris 9 on SPARC. 64 | - saner usage of /dev/[u]random is required -- throw warning when not in 65 | daemon mode (patch 873497 -- needs work) 66 | - clean up documentation and tarball contents 67 | + reorganize directory structure 68 | - AES support -- requires OpenSSL 0.9.7 dybbuk 69 | 70 | 71 | Abandoned/Deferred: 72 | D Remove OpenSSL version checks. Maybe print a message stating the 73 | supported versions, and leave it up to the user? 74 | D allow for verification of clearsigned OpenPGP messages disastry 75 | D honor key preferences when encrypting to multiple keys ulf/disastry (n/a) 76 | D further mpgp testing of AES/MDC packet support ulf 77 | D make mpgp friendlier 78 | D COMMENT entire existing codebase! (HAHA) 79 | D support for Borland compiler on Windows. 80 | D I'ld even go so far as drop Visual C (or whatever we're supporting at 81 | the moment) and require gcc with Cygwin to build it. But only if this 82 | results in a Binary that runs without additional DLLs. (Weasel) 83 | -------------------------------------------------------------------------------- /Src/menuutil.c: -------------------------------------------------------------------------------- 1 | /* Mixmaster version 3.1 -- (C) 1999 - 2016 Anonymizer Inc. and others. 2 | 3 | Mixmaster may be redistributed and modified under certain conditions. 4 | This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 5 | ANY KIND, either express or implied. See the file COPYRIGHT for 6 | details. 7 | 8 | Menu-based user interface - utility functions 9 | $Id$ */ 10 | 11 | 12 | #include "menu.h" 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | int menu_initialized = 0; 19 | 20 | #ifdef USE_NCURSES 21 | void cl(int y, int x) 22 | { 23 | move(y, x); 24 | hline(' ', COLS - x); 25 | } 26 | #endif /* USE_NCURSES */ 27 | 28 | void menu_init(void) 29 | { 30 | #ifdef USE_NCURSES 31 | initscr(); 32 | cbreak(); 33 | noecho(); 34 | nonl(); 35 | intrflush(stdscr, FALSE); 36 | keypad(stdscr, TRUE); 37 | menu_initialized = 1; 38 | #endif /* USE_NCURSES */ 39 | } 40 | 41 | void menu_exit(void) 42 | { 43 | user_delpass(); 44 | #ifdef USE_NCURSES 45 | endwin(); 46 | #endif /* USE_NCURSES */ 47 | } 48 | 49 | #ifdef USE_NCURSES 50 | void askfilename(char *path) 51 | { 52 | char line[PATHMAX]; 53 | 54 | printw("\rFile name: "); 55 | echo(); 56 | wgetnstr(stdscr, path, PATHMAX); 57 | noecho(); 58 | printw("\r"); 59 | if (path[0] == '~') { 60 | char *h; 61 | 62 | if ((h = getenv("HOME")) != NULL) { 63 | strncpy(line, h, PATHMAX); 64 | strcatn(line, "/", PATHMAX); 65 | strcatn(line, path + 1, PATHMAX); 66 | strncpy(path, line, PATHMAX); 67 | } 68 | } 69 | } 70 | 71 | void savemsg(BUFFER *message) 72 | { 73 | char savename[PATHMAX]; 74 | FILE *f; 75 | 76 | askfilename(savename); 77 | f = fopen(savename, "a"); 78 | if (f != NULL) { 79 | buf_write(message, f); 80 | fclose(f); 81 | } 82 | } 83 | 84 | #endif /* USE_NCURSES */ 85 | 86 | void menu_spawn_editor(char *path, int lineno) { 87 | #ifdef WIN32 88 | SHELLEXECUTEINFO sei; 89 | ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO)); 90 | sei.cbSize = sizeof(SHELLEXECUTEINFO); 91 | sei.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_DDEWAIT; 92 | sei.hwnd = NULL; 93 | sei.lpVerb = "open"; 94 | sei.nShow = SW_SHOWNORMAL; 95 | // next 2 settings from RTC 96 | sei.lpFile = "notepad.exe"; 97 | sei.lpParameters = path; 98 | 99 | if (ShellExecuteEx(&sei) == TRUE) { 100 | WaitForSingleObject(sei.hProcess, INFINITE); 101 | CloseHandle(sei.hProcess); 102 | } 103 | #else /* WIN32 */ 104 | char *editor; 105 | char s[PATHMAX]; 106 | 107 | /* Command line option +nn to position the cursor? */ 108 | #define cursorpos (strfind(editor, "emacs") || streq(editor, "vi") || \ 109 | streq(editor, "joe")) 110 | 111 | editor = getenv("EDITOR"); 112 | if (editor == NULL) 113 | editor = "vi"; 114 | 115 | if (lineno > 1 && cursorpos) 116 | snprintf(s, PATHMAX, "%s +%d %s", editor, lineno, path); 117 | else 118 | snprintf(s, PATHMAX, "%s %s", editor, path); 119 | 120 | #ifdef USE_NCURSES 121 | clear(); 122 | refresh(); 123 | endwin(); 124 | #endif /* USE_NCURSES */ 125 | system(s); 126 | #ifdef USE_NCURSES 127 | refresh(); 128 | #endif /* USE_NCURSES */ 129 | 130 | #endif /* WIN32 */ 131 | } 132 | 133 | int menu_getuserpass(BUFFER *b, int mode) 134 | { 135 | #ifdef USE_NCURSES 136 | char p[LINELEN]; 137 | 138 | if (menu_initialized) { 139 | cl(LINES - 1, 10); 140 | if (mode == 0) 141 | printw("enter passphrase: "); 142 | else 143 | printw("re-enter passphrase: "); 144 | wgetnstr(stdscr, p, LINELEN); 145 | cl(LINES - 1, 10); 146 | refresh(); 147 | if (mode == 0) 148 | buf_appends(b, p); 149 | else 150 | return (bufeq(b, p)); 151 | return (0); 152 | } 153 | #endif /* USE_NCURSES */ 154 | return (-1); 155 | } 156 | -------------------------------------------------------------------------------- /mpgp.1: -------------------------------------------------------------------------------- 1 | .TH MPGP 1 "Mixmaster Version 3.0" 2 | .\" $Id: $ 3 | .SH NAME 4 | mpgp \- Mixmaster OpenPGP Module 5 | .SH SYNOPSIS 6 | .B mpgp \fB\-e\fR [\fB\-b\fR] \fIkeyname\fR [\fIfilename\fR] 7 | .PP 8 | .B mpgp \fB\-s\fR [\fB\-b\fR] [\fIkeyname\fR [\fIfilename\fR]] 9 | .PP 10 | .B mpgp \fB\-c\fR [\fB\-b\fR] [\fIfilename\fR] 11 | .PP 12 | .B mpgp \fB\-C\fR [\fB\-b\fR] [\fIfilename\fR] 13 | .PP 14 | .B mpgp \fB\-d\fR [\fB\-b\fR] [\fIpassphrase\fR [\fIfilename\fR]] 15 | .PP 16 | .B mpgp \fB\-g\fR[\fBr\fR] \fIkeyname\fR [\fIbits\fR] 17 | .PP 18 | .B mpgp \fB\-a\fR[\fB+\-\fR] [\fB\-b\fR] [\fIfilename\fR] 19 | .PP 20 | .B mpgp \fB\-V\fR 21 | .SH DESCRIPTION 22 | Mixmaster is an anonymous remailer. mpgp is a light-weight OpenPGP 23 | implementation, primarily used to diagnose issues with OpenPGP keys and 24 | messages handled by the Mixmaster remailer software. 25 | .PP 26 | mpgp can encrypt, decrypt and sign a message using the Mixmaster 27 | OpenPGP library. The message is read from the standard input or the 28 | specified \fIfilename\fR. The output will be written to the standard 29 | output. When called without arguments mpgp decrypts from the standard 30 | input. It asks for a passphrase when needed. 31 | .SH OPTIONS 32 | .TP 33 | .B "\-h" 34 | Print a summary of command line options. 35 | .TP 36 | .B "\-V" 37 | Print the current version, authorship and copyright information. 38 | .TP 39 | .B "\-e" 40 | Encrypt a message with the first OpenPGP key from the public key ring 41 | whose contains \fIkeyname\fR as a substring. 42 | .TP 43 | .B "\-s" 44 | Make a signature of the message with the first OpenPGP key from the secret 45 | key ring, or the first key whose contains \fIkeyname\fR as a substring if 46 | specified. 47 | .TP 48 | .B "\-c" 49 | Encrypt with symmetric cipher only. 50 | .TP 51 | .B "\-C" 52 | Encrypt with symmetric cipher only using the new OpenPGP format. 53 | .TP 54 | .B "\-d" 55 | Decrypt a message using \fIpassphrase\fR if specified or asking for it if 56 | needed. It also verifies its signature. 57 | .TP 58 | .B "\-g\fR[\fBr\fR]" 59 | Generate new OpenPGP key pair with the given \fIkeyname\fR as user ID. If 60 | \fBr\fR is specified the OpenPGP key will be created using the RSA 61 | algorithm, otherwise the ElGamal algorithm will be used. \fIbits\fR is the 62 | key length and its default value is 1024. 63 | .TP 64 | .B "\-a\fR[\fB+\-\fR]" 65 | Create an ASCII OpenPGP armored message. If \fB\-\fR is specified mpgp 66 | will remove ASCII armor. 67 | .TP 68 | .B "\-b" 69 | Specifies that the message is in binary format. 70 | .SH CONFIGURATION 71 | The Mixmaster OpenPGP module reads its configuration from the file 72 | .B mix.cfg 73 | in its working directory. The configuration file consists of lines of 74 | the type 75 | .PP 76 | .I VARIABLE values 77 | .PP 78 | and of comments, which begin with a 79 | .B # 80 | character. 81 | .PP 82 | .TP 83 | .B PGPPUBRING 84 | Path to your public OpenPGP key ring. Default: 85 | .BR ~/.pgp/pubring.pgp . 86 | (Windows default: PGP registry value.) 87 | .TP 88 | .B PGPSECRING 89 | Path to your secret OpenPGP key ring. Default: 90 | .BR ~/.pgp/secring.pgp . 91 | (Windows default: PGP registry value.) 92 | .SH FILES 93 | These filenames can be overridden by setting the corresponding configuration 94 | option (given in parentheses). 95 | .TP 96 | .B mix.cfg 97 | Mixmaster configuration file. 98 | .TP 99 | .B pubring.pgp 100 | OpenPGP public keys (\fBPGPPUBRING\fP). 101 | .TP 102 | .B secring.pgp 103 | OpenPGP secret keys (\fBPGPSECRING\fP). 104 | .SH SEE ALSO 105 | .BR mixmaster (1), 106 | .BR pgp (1), 107 | .BR gpg (1). 108 | .SH HISTORY 109 | The 110 | .BR mpgp 111 | command was written by Ulf Moeller as a test suite for Mixmaster 112 | 2.9's internal OpenPGP support. It was enhanced and debugged primarily 113 | by Janis Jagars for use as a light-weight stand-alone OpenPGP application. 114 | .SH COPYRIGHT 115 | (C) 1999-2006 Ulf Moeller and others. 116 | Mixmaster and 117 | .BR mpgp 118 | may be redistributed and modified under certain 119 | conditions. This software is distributed on an "AS IS" basis, WITHOUT 120 | WARRANTY OF ANY KIND, either express or implied. See the file COPYRIGHT 121 | for details. 122 | -------------------------------------------------------------------------------- /Src/rndseed.c: -------------------------------------------------------------------------------- 1 | /* Mixmaster version 3.1 -- (C) 1999 - 2016 Anonymizer Inc. and others. 2 | 3 | Mixmaster may be redistributed and modified under certain conditions. 4 | This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 5 | ANY KIND, either express or implied. See the file COPYRIGHT for 6 | details. 7 | 8 | Get randomness from device or user 9 | $Id$ */ 10 | 11 | 12 | #include "mix3.h" 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #ifdef POSIX 19 | #include 20 | #include 21 | #else /* end of POSIX */ 22 | #include 23 | #include 24 | #endif /* else if not POSIX */ 25 | #if defined(WIN32) || defined(MSDOS) 26 | #include 27 | #endif /* defined(WIN32) || defined(MSDOS) */ 28 | #ifdef WIN32 29 | #include 30 | #endif /* WIN32 */ 31 | 32 | #define NEEDED 128 33 | 34 | #ifndef O_NDELAY 35 | #define O_NDELAY 0 36 | #endif /* not O_NDELAY */ 37 | 38 | int kbd_noecho(void) 39 | { 40 | #ifdef HAVE_TERMIOS 41 | int fd; 42 | struct termios attr; 43 | 44 | setbuf(stdin, NULL); 45 | fd = fileno(stdin); 46 | if (tcgetattr(fd, &attr) != 0) 47 | return (-1); 48 | attr.c_lflag &= ~(ECHO | ICANON); 49 | if (tcsetattr(fd, TCSAFLUSH, &attr) != 0) 50 | return (-1); 51 | #endif /* HAVE_TERMIOS */ 52 | return (0); 53 | } 54 | 55 | int kbd_echo(void) 56 | { 57 | #ifdef HAVE_TERMIOS 58 | int fd; 59 | struct termios attr; 60 | 61 | setvbuf(stdin, NULL, _IOLBF, BUFSIZ); 62 | fd = fileno(stdin); 63 | if (tcgetattr(fd, &attr) != 0) 64 | return (-1); 65 | attr.c_lflag |= ECHO | ICANON; 66 | if (tcsetattr(fd, TCSAFLUSH, &attr) != 0) 67 | return (-1); 68 | #endif /* HAVE_TERMIOS */ 69 | return (0); 70 | } 71 | 72 | void rnd_error(void) 73 | { 74 | errlog(ERRORMSG, 75 | "Random number generator not initialized. Aborting.\n\ 76 | Run the program interactively to seed the generator.\n"); 77 | exit(3); 78 | } 79 | 80 | /* get randomness from system or user. If the application has promised that 81 | it will seed the RNG later, we do not ask for user input */ 82 | 83 | int rnd_seed(void) 84 | { 85 | int fd = -1; 86 | byte b[512], c = 0; 87 | int bytes = 0; 88 | 89 | #ifdef DEV_RANDOM 90 | fd = open(DEV_RANDOM, O_RDONLY | O_NDELAY); 91 | #endif /* DEV_RANDOM */ 92 | if (fd == -1) { 93 | #if 1 94 | if (rnd_state == RND_WILLSEED) 95 | return(-1); 96 | if (!isatty(fileno(stdin))) 97 | rnd_error(); 98 | #else /* end of 1 */ 99 | #error "should initialize the prng from system resources" 100 | #endif /* else if not 1 */ 101 | fprintf(stderr, "Please enter some random characters.\n"); 102 | kbd_noecho(); 103 | while (bytes < NEEDED) { 104 | fprintf(stderr, " %d \r", NEEDED - bytes); 105 | #ifdef HAVE_GETKEY 106 | if (kbhit(), *b = getkey()) 107 | #else /* end of HAVE_GETKEY */ 108 | if (read(fileno(stdin), b, 1) > 0) 109 | #endif /* else if not HAVE_GETKEY */ 110 | { 111 | rnd_add(b, 1); 112 | rnd_time(); 113 | if (*b != c) 114 | bytes++; 115 | c = *b; 116 | } 117 | } 118 | fprintf(stderr, "Thanks.\n"); 119 | sleep(1); 120 | kbd_echo(); 121 | } 122 | #ifdef DEV_RANDOM 123 | else { 124 | bytes = read(fd, b, sizeof(b)); 125 | if (bytes > 0) { 126 | rnd_add(b, bytes); 127 | } else { 128 | bytes = 0; 129 | } 130 | close(fd); 131 | if (bytes < NEEDED) { 132 | fd = open(DEV_RANDOM, O_RDONLY); /* re-open in blocking mode */ 133 | if (isatty(fileno(stdin))) { 134 | fprintf(stderr, 135 | "Please move the mouse, enter random characters, etc.\n"); 136 | kbd_noecho(); 137 | } 138 | while (bytes < NEEDED) { 139 | if (isatty(fileno(stdin))) 140 | fprintf(stderr, " %d \r", NEEDED - bytes); 141 | if (read(fd, b, 1) > 0) { 142 | rnd_add(b, 1); 143 | bytes++; 144 | } 145 | } 146 | if (isatty(fileno(stdin))) { 147 | fprintf(stderr, "Thanks.\n"); 148 | sleep(1); 149 | kbd_echo(); 150 | } 151 | close(fd); 152 | } 153 | } 154 | #endif /* DEV_RANDOM */ 155 | rnd_state = RND_SEEDED; 156 | return (0); 157 | } 158 | -------------------------------------------------------------------------------- /conf/abuse.txt.in: -------------------------------------------------------------------------------- 1 | Thank you for contacting the Abuse Complaint Administrator 2 | of the %RMN. 3 | 4 | We sincerely apologize for any inconvenience that you may have 5 | experienced as a result of inappropriate use of this system by a 6 | particular individual. 7 | 8 | The purpose of this anonymous remailer is to permit individuals 9 | including crime victims, domestic violence victims, persons in recovery, 10 | and others, such as those living under oppressive regimes, to 11 | communicate confidentially in a manner that ensures their privacy under 12 | even the most adverse conditions. Unfortunately, there will always be a 13 | very small percentage of individuals that choose to abuse the anonymity 14 | that this and similar systems worldwide afford to insult, harass, or 15 | send otherwise unwelcome email. 16 | 17 | The operator of this remailer does not condone such messages, or their 18 | content, in any way. 19 | 20 | Just as the Post Office is unable to prevent abuse of the mail system as 21 | long as there are public mailboxes into which a person can drop a letter 22 | without including a return address, this remailer cannot preemptively 23 | prevent irresponsible individuals from using this system to send 24 | inappropriate messages. However, unlike the Post Office, this remailer 25 | enables you to assure that you will not be inconvenienced by users of 26 | this remailer in the future. 27 | ========================================================================= 28 | 29 | How to block your email address from receiving email from the 30 | %RMN: 31 | 32 | To block the users of this remailer from sending email to your address, 33 | please send a message to <%RMA> 34 | containing the line 35 | 36 | DESTINATION-BLOCK 37 | 38 | anywhere in the body text of the email. You can simply reply to this 39 | message using your email program and send back this entire message for 40 | your current email address to be permanently blocked from users of the 41 | %RMN. 42 | 43 | If you wish to block additional email addresses that you may use from 44 | receiving email though this remailer, please reply to this email with a 45 | line similar to 46 | 47 | DESTINATION-BLOCK my_other_email_address@my_domain.com 48 | 49 | You must include one such line per email address that you wish to block. 50 | You can include more than one line in your reply. 51 | ========================================================================== 52 | 53 | How to block an entire domain from receiving email from the 54 | %RMN: 55 | 56 | If you are the legitimate root administrator or postmaster of a domain, 57 | you may request that all email addresses served by you domain are 58 | blocked from receiving email from this remailer . To place this block, 59 | please send the following line as "root" or "postmaster" to 60 | <%RMA> in the body text of your email: 61 | 62 | DESTINATION-BLOCK @domain_to_be_blocked.com 63 | 64 | ========================================================================== 65 | Note that there are similar remailer systems in operation on the 66 | Internet that not affiliated with the %RMN. 67 | 68 | Since the administrator of this remailer has no influence on those other 69 | systems and is likely to be unaware of many of these other systems, a 70 | destination block that you may choose to request by replying to this 71 | email is only effective for the %RMN, 72 | not for similar systems that may exist on the Internet. 73 | 74 | ========================================================================== 75 | 76 | How to obtain the name of the sender of an email that you received 77 | though this remailer: 78 | 79 | This remailer uses the Mixmaster anonymous remailer software. The 80 | Mixmaster software has been carefully designed to withstand attack by 81 | even the most severe regimes in which torture is a common means of 82 | inquiry and basic human rights are nonexistent. As such, it is 83 | impossible to determine the original sender of an email that has passed 84 | through this system. 85 | 86 | The administrator of this system is technically unable to determine the 87 | original sender of a message that has passed through this remailer, no 88 | matter how much the administrator may desire to do so, even if the 89 | administrator were ordered to do so by legal or extra-legal means. We 90 | regret any inconvenience this necessary safety protection may cause to 91 | some recipients of undesired emails. 92 | 93 | Remember: you can prevent future unwanted emails sent to you via this 94 | remailer by simply replying to this message. 95 | 96 | Sincerely, 97 | 98 | -- The %RMN Administrator 99 | 100 | -------------------------------------------------------------------------------- /conf/type1.hlp: -------------------------------------------------------------------------------- 1 | This remailer will permit you to remail messages without using the 2 | Mixmaster client software or PGP. This mode of operation is known to be 3 | insecure and should generally be used for testing purposes only. The 4 | operator of this remailer, all system administrators of the many 5 | machines through which your email will pass on the way to its 6 | destination, and any 15-year-old-hacker that may have broken into any of 7 | the many machines through which your email will pass may be able to 8 | determine that you are the original sender of the email. 9 | 10 | However, you may find this insecure mode useful for testing and 11 | debugging purposes or to just send a quick email without exposing your 12 | real email address to spam harvesters gathering email addresses from 13 | mailing lists. To use the insecure mode, send mail to <%RMA>. Place a 14 | blank line into the first line, two colons in the second line of your 15 | message, and the line "Anon-To: address" in the third line of your 16 | message. Follow that with another blank line and begin your message. For 17 | example: 18 | 19 | ================================================================== 20 | From: remailer_user@sender_domain.com 21 | To: %RMA Subject: anonymous message 22 | 23 | :: 24 | Anon-To: final_recipient@destination_domain.com 25 | 26 | Dear Domestic Violence List Members, 27 | My husband has physically abused me for most of the 18 years of our marriage. 28 | I can't tell you how many times I had to come up with excuses as to why I had 29 | those bruises or that black eye. I stayed in the marriage for the sake of 30 | our daughter. 31 | But recently, my husband has started to touch our 14-year-old daughter. 32 | I don't know what to do. I am afraid my husband will kill me if I say 33 | something. I am even more afraid for my daughter. I have no money; my 34 | husband controls all the bank accounts. What can I do? 35 | 36 | Please help, 37 | -- Desperate. 38 | ================================================================== 39 | 40 | The remailer will remove all header lines, and forward the message to 41 | the destination. The following e-mail would be delivered to 42 | : 43 | 44 | ================================================================== 45 | From: %RMN <%RAA> 46 | Comments: This message did not originate from the Sender 47 | address above. It was remailed automatically by anonymizing remailer 48 | software. Please report problems or inappropriate use to the remailer 49 | administrator at <%CA>. 50 | To: final_recipient@destination_domain.com 51 | 52 | Dear Domestic Violence List Members, 53 | My husband has physically abused me for most of the 18 years of our 54 | marriage. 55 | I can't tell you how many times I had to come up with excuses as to why 56 | I had those bruises or that black eye. I stayed in the marriage for 57 | the sake of our daughter. 58 | But recently, my husband has started to touch our 14-year-old daughter. 59 | I don't know what to do. I am afraid my husband will kill me if I say 60 | something. I am even more afraid for my daughter. I have no money; my 61 | husband controls all the bank accounts. What can I do? 62 | 63 | Please help, 64 | -- Desperate. 65 | ================================================================== 66 | 67 | You frequently will wish to include a Subject or other header lines in 68 | your remailed email. You can insert header lines in the remailed message 69 | by preceding them with a "##" line: 70 | 71 | ================================================================== 72 | From: remailer_user@sender_domain.com 73 | To: %RMA 74 | 75 | :: 76 | Anon-To: final_recipient@destination_domain.com 77 | 78 | ## 79 | Subject: Re: Remailer Test Message 80 | In-Reply-To: Your message of "Tue, 12 Jan 1999 22:47:04 EST." 81 | <199901130247.WAA02761@destiation_domain.com> 82 | 83 | Dear Desperate, 84 | Just like you, I was stuck in an abusive marriage for 85 | many years. I don't need to tell you what you already know: if not for 86 | your sake, for the sake of your daughter, you need to get away from your 87 | husband immediately. At the moment, you may think your husband has all 88 | the power and that you are powerless. You are not powerless. Contact the 89 | National Center against Domestic Violence today and ask about the 90 | address and phone number of a women's shelter near where you live. The 91 | people there will show you how you can free yourself from the yoke of 92 | brutality and protect your daughter from the worst. 93 | 94 | Please post another anonymous email to this list if you are having any 95 | difficulties in locating a women's shelter. 96 | 97 | -- Broken Free 98 | ================================================================== 99 | **** 100 | 101 | -------------------------------------------------------------------------------- /win32/mix.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mix", "mix.vcproj", "{075AD568-26A6-4C0F-9D78-60E6BA2FD7CC}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | {BE1E2A5D-7460-4F06-AEEB-9443B1EE1844} = {BE1E2A5D-7460-4F06-AEEB-9443B1EE1844} 5 | EndProjectSection 6 | EndProject 7 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mixlib", "mixlib.vcproj", "{BE1E2A5D-7460-4F06-AEEB-9443B1EE1844}" 8 | ProjectSection(ProjectDependencies) = postProject 9 | {FC9B2030-6750-4272-87C9-6E46AB029F69} = {FC9B2030-6750-4272-87C9-6E46AB029F69} 10 | {F587947F-949D-4AD6-A527-3A34918741B5} = {F587947F-949D-4AD6-A527-3A34918741B5} 11 | {6A9ECAB3-1CA6-4E2A-8A15-F8AE459BB174} = {6A9ECAB3-1CA6-4E2A-8A15-F8AE459BB174} 12 | EndProjectSection 13 | EndProject 14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcre", "Pcre.vcproj", "{FC9B2030-6750-4272-87C9-6E46AB029F69}" 15 | ProjectSection(ProjectDependencies) = postProject 16 | {63F7F010-3302-4329-A9AC-9739FC57EC51} = {63F7F010-3302-4329-A9AC-9739FC57EC51} 17 | EndProjectSection 18 | EndProject 19 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcre_chartables", "Pcre_Chartables.vcproj", "{63F7F010-3302-4329-A9AC-9739FC57EC51}" 20 | ProjectSection(ProjectDependencies) = postProject 21 | EndProjectSection 22 | EndProject 23 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib.vcproj", "{6A9ECAB3-1CA6-4E2A-8A15-F8AE459BB174}" 24 | ProjectSection(ProjectDependencies) = postProject 25 | EndProjectSection 26 | EndProject 27 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pdcurses", "pdcurses.vcproj", "{F587947F-949D-4AD6-A527-3A34918741B5}" 28 | ProjectSection(ProjectDependencies) = postProject 29 | EndProjectSection 30 | EndProject 31 | Global 32 | GlobalSection(SolutionConfiguration) = preSolution 33 | Debug = Debug 34 | Release = Release 35 | Release Static = Release Static 36 | EndGlobalSection 37 | GlobalSection(ProjectConfiguration) = postSolution 38 | {075AD568-26A6-4C0F-9D78-60E6BA2FD7CC}.Debug.ActiveCfg = Release Static|Win32 39 | {075AD568-26A6-4C0F-9D78-60E6BA2FD7CC}.Debug.Build.0 = Release Static|Win32 40 | {075AD568-26A6-4C0F-9D78-60E6BA2FD7CC}.Release.ActiveCfg = Release|Win32 41 | {075AD568-26A6-4C0F-9D78-60E6BA2FD7CC}.Release.Build.0 = Release|Win32 42 | {075AD568-26A6-4C0F-9D78-60E6BA2FD7CC}.Release Static.ActiveCfg = Release Static|Win32 43 | {075AD568-26A6-4C0F-9D78-60E6BA2FD7CC}.Release Static.Build.0 = Release Static|Win32 44 | {BE1E2A5D-7460-4F06-AEEB-9443B1EE1844}.Debug.ActiveCfg = Release|Win32 45 | {BE1E2A5D-7460-4F06-AEEB-9443B1EE1844}.Debug.Build.0 = Release|Win32 46 | {BE1E2A5D-7460-4F06-AEEB-9443B1EE1844}.Release.ActiveCfg = Release|Win32 47 | {BE1E2A5D-7460-4F06-AEEB-9443B1EE1844}.Release.Build.0 = Release|Win32 48 | {BE1E2A5D-7460-4F06-AEEB-9443B1EE1844}.Release Static.ActiveCfg = Release|Win32 49 | {BE1E2A5D-7460-4F06-AEEB-9443B1EE1844}.Release Static.Build.0 = Release|Win32 50 | {FC9B2030-6750-4272-87C9-6E46AB029F69}.Debug.ActiveCfg = Release|Win32 51 | {FC9B2030-6750-4272-87C9-6E46AB029F69}.Debug.Build.0 = Release|Win32 52 | {FC9B2030-6750-4272-87C9-6E46AB029F69}.Release.ActiveCfg = Release|Win32 53 | {FC9B2030-6750-4272-87C9-6E46AB029F69}.Release.Build.0 = Release|Win32 54 | {FC9B2030-6750-4272-87C9-6E46AB029F69}.Release Static.ActiveCfg = Release|Win32 55 | {FC9B2030-6750-4272-87C9-6E46AB029F69}.Release Static.Build.0 = Release|Win32 56 | {63F7F010-3302-4329-A9AC-9739FC57EC51}.Debug.ActiveCfg = Release|Win32 57 | {63F7F010-3302-4329-A9AC-9739FC57EC51}.Debug.Build.0 = Release|Win32 58 | {63F7F010-3302-4329-A9AC-9739FC57EC51}.Release.ActiveCfg = Release|Win32 59 | {63F7F010-3302-4329-A9AC-9739FC57EC51}.Release.Build.0 = Release|Win32 60 | {63F7F010-3302-4329-A9AC-9739FC57EC51}.Release Static.ActiveCfg = Release|Win32 61 | {63F7F010-3302-4329-A9AC-9739FC57EC51}.Release Static.Build.0 = Release|Win32 62 | {6A9ECAB3-1CA6-4E2A-8A15-F8AE459BB174}.Debug.ActiveCfg = Release|Win32 63 | {6A9ECAB3-1CA6-4E2A-8A15-F8AE459BB174}.Debug.Build.0 = Release|Win32 64 | {6A9ECAB3-1CA6-4E2A-8A15-F8AE459BB174}.Release.ActiveCfg = Release|Win32 65 | {6A9ECAB3-1CA6-4E2A-8A15-F8AE459BB174}.Release.Build.0 = Release|Win32 66 | {6A9ECAB3-1CA6-4E2A-8A15-F8AE459BB174}.Release Static.ActiveCfg = Release|Win32 67 | {6A9ECAB3-1CA6-4E2A-8A15-F8AE459BB174}.Release Static.Build.0 = Release|Win32 68 | {F587947F-949D-4AD6-A527-3A34918741B5}.Debug.ActiveCfg = Release|Win32 69 | {F587947F-949D-4AD6-A527-3A34918741B5}.Debug.Build.0 = Release|Win32 70 | {F587947F-949D-4AD6-A527-3A34918741B5}.Release.ActiveCfg = Release|Win32 71 | {F587947F-949D-4AD6-A527-3A34918741B5}.Release.Build.0 = Release|Win32 72 | {F587947F-949D-4AD6-A527-3A34918741B5}.Release Static.ActiveCfg = Release|Win32 73 | {F587947F-949D-4AD6-A527-3A34918741B5}.Release Static.Build.0 = Release|Win32 74 | EndGlobalSection 75 | GlobalSection(ExtensibilityGlobals) = postSolution 76 | EndGlobalSection 77 | GlobalSection(ExtensibilityAddIns) = postSolution 78 | EndGlobalSection 79 | EndGlobal 80 | -------------------------------------------------------------------------------- /conf/rlist.txt: -------------------------------------------------------------------------------- 1 | $remailer{"3nails"} = "<3nails@peculiar.user32.com> cpunk mix hybrid middle pgp pgponly latent ek ekx esub cut hash repgp remix reord ext max test inflt75 rhop5 klen1000"; 2 | $remailer{"anon"} = " cpunk max mix middle pgp pgponly repgp remix latent hash cut test ekx inflt50 rhop5 reord post klen1024"; 3 | $remailer{"austria"} = " cpunk max mix pgp pgponly repgp remix latent hash cut test ekx inflt50 rhop5 reord klen1024"; 4 | $remailer{"awxcnx"} = " cpunk max mix middle pgp pgponly repgp remix latent hash cut test ekx inflt50 rhop5 reord post klen900"; 5 | $remailer{"breaka"} = " cpunk max mix pgp pgponly repgp remix latent hash cut test ekx inflt50 rhop5 reord post"; 6 | $remailer{"cmeclax"} = " cpunk max mix middle pgp pgponly repgp remix latent hash cut test ekx hsub inflt50 rhop5 reord"; 7 | $remailer{"cripto"} = " cpunk max mix middle pgp pgponly repgp remix latent hash cut test ekx inflt50 rhop5 reord post klen150"; 8 | $remailer{"dizum"} = " cpunk max mix pgp pgponly repgp remix latent hash cut test ek ekx esub inflt50 rhop5 reord post klen64"; 9 | $remailer{"freierede"} = " cpunk max mix middle pgp pgponly repgp remix latent hash cut test ekx inflt50 rhop5 reord post"; 10 | $remailer{"frell"} = " cpunk max mix pgp pgponly repgp remix latent hash cut test ek ekx esub inflt50 rhop5 reord post klen1024"; 11 | $remailer{"hermetix"} = " cpunk max mix middle pgp pgponly repgp remix latent hash cut test ekx inflt50 rhop5 reord post klen5000"; 12 | $remailer{"hsub"} = " cpunk max middle pgp pgponly repgp remix esubbf hsub latent hash cut test ekx inflt50 rhop5 reord klen100"; 13 | $remailer{"kreti"} = " cpunk max mix pgp pgponly repgp remix latent hash cut test ekx inflt50 rhop5 reord post"; 14 | $remailer{"kroken"} = " cpunk mix middle pgp pgponly repgp remix latent hash cut test ek ekx esub inflt50 rhop20 reord klen1024"; 15 | $remailer{"paranoia"} = " cpunk max mix pgp pgponly repgp remix esubbf hsub latent hash cut test ekx inflt50 rhop5 reord post klen150"; 16 | $remailer{"raspberry"} = " cpunk max mix middle pgp pgponly repgp remix latent hash cut test ekx inflt50 rhop5 reord post klen256"; 17 | $remailer{"senshi"} = " cpunk middle pgp latent ek ekx esub cut hash repgp reord ext max test inflt10 rhop2 klen200"; 18 | $remailer{"slug"} = " cpunk max mix pgp pgponly repgp remix esubbf hsub latent hash cut test ekx inflt50 rhop5 reord"; 19 | 20 | Groups of remailers sharing a machine or operator: 21 | (banana hsub slow) 22 | 23 | 24 | Broken type-I remailer chains: 25 | (* senshi) 26 | (3nails dizum) 27 | (3nails slug) 28 | (anon slug) 29 | (dizum hermetix) 30 | (frell dizum) 31 | (frell slug) 32 | (raspberry hsub) 33 | (slug anon) 34 | (slug austria) 35 | 36 | Broken type-II remailer chains: 37 | (3nails bunker) 38 | (3nails dizum) 39 | (austria bunker) 40 | (devurandom slug) 41 | (eurovibes bunker) 42 | (fotonl1 bunker) 43 | (fotonl1 slug) 44 | (freierede slug) 45 | (frell bunker) 46 | (frell dizum) 47 | (hermetix slug) 48 | (kreti slug) 49 | (kroken bunker) 50 | (kroken slug) 51 | (lulunga slug) 52 | (paranoia slug) 53 | (pobox slug) 54 | (rabbi bunker) 55 | (raspberry bunker) 56 | (raspberry slug) 57 | (slow bunker) 58 | (slug austria) 59 | (slug awxcnx) 60 | (slug bunker) 61 | (slug dizum) 62 | (slug fotonl1) 63 | (slug hermetix) 64 | (slug lulunga) 65 | (slug pobox) 66 | 67 | Last update: Fri 30 Nov 2012 10:20:00 GMT 68 | remailer email address history latency uptime 69 | ----------------------------------------------------------------------- 70 | austria mixmaster@remailer.privacy.at ************ 26:30 100.00% 71 | breaka remailer@breaka.net ************ 26:59 100.00% 72 | cripto anon@ecn.org ************ 27:00 100.00% 73 | paranoia mixmaster@remailer.paranoici.org ************ 32:30 100.00% 74 | raspberr mixmaster@drooper.mixmin.net ************ 15:30 100.00% 75 | dizum remailer@dizum.com ************ 16:00 99.94% 76 | kroken remailer@kroken.dynalias.com ++**+*+*++++ 1:02:00 99.73% 77 | cmeclax cmeclax@ixazon.dynip.com +++++*++++++ 1:15:00 99.67% 78 | anon anon@anonusa.net ************ 23:00 99.56% 79 | 3nails 3nails@peculiar.user32.com ++++-+++-+++ 1:28:00 99.44% 80 | hsub hsub@mixmaster.mixmin.net +-++++-----+ 4:12:30 99.27% 81 | frell godot@remailer.frell.eu.org -----------+ 5:42:00 99.24% 82 | freiered mixmaster@freie-re.de +*++*+++++++ 1:18:29 99.22% 83 | awxcnx mix@awxcnx.de +++++*+*++++ 1:16:00 98.32% 84 | senshi senshiremailer@gmx.de +-++++++-+++ 3:26:00 96.88% 85 | kreti mixmaster@mail.hoi-polloi.org +++**+++*++* 1:23:00 95.35% 86 | hermetix mix@hermetix.org ++++++++++++ 1:43:30 50.44% 87 | slug mix@slug.slugish.net ******** 16:00 48.45% 88 | -------------------------------------------------------------------------------- /Src/random.c: -------------------------------------------------------------------------------- 1 | /* Mixmaster version 3.1 -- (C) 1999 - 2016 Anonymizer Inc. and others. 2 | 3 | Mixmaster may be redistributed and modified under certain conditions. 4 | This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 5 | ANY KIND, either express or implied. See the file COPYRIGHT for 6 | details. 7 | 8 | Randomness 9 | $Id$ */ 10 | 11 | 12 | #include "mix3.h" 13 | #include "crypto.h" 14 | #include 15 | #ifdef POSIX 16 | #include 17 | #include 18 | #else /* end of POSIX */ 19 | #include 20 | #include 21 | #endif /* else if not POSIX */ 22 | #ifdef WIN32 23 | #include 24 | #endif /* WIN32 */ 25 | #include 26 | #include 27 | 28 | int rnd_state = RND_NOTSEEDED; 29 | 30 | #ifdef USE_OPENSSL 31 | int rnd_init(void) 32 | { 33 | char r[PATHMAX]; 34 | int n; 35 | LOCK *rndlock; 36 | 37 | if (rnd_state == RND_SEEDED) 38 | return(0); 39 | rndlock = lockfile(MIXRAND); 40 | mixfile(r, MIXRAND); 41 | n = RAND_load_file(r, 1024); 42 | if (n < 256 && rnd_seed() == -1) 43 | goto err; 44 | rnd_time(); 45 | RAND_write_file(r); 46 | rnd_state = RND_SEEDED; 47 | err: 48 | unlockfile(rndlock); 49 | return (rnd_state == RND_SEEDED ? 0 : -1); 50 | } 51 | 52 | int rnd_final(void) 53 | { 54 | int err = 0; 55 | char r[PATHMAX]; 56 | LOCK *rndlock; 57 | 58 | if (rnd_state != RND_SEEDED) 59 | return(-1); 60 | 61 | rnd_update(NULL, 0); 62 | rndlock = lockfile(MIXRAND); 63 | mixfile(r, MIXRAND); 64 | RAND_load_file(r, 1024); /* add seed file again in case other instances 65 | of the program have used it */ 66 | if (RAND_write_file(r) < 1) 67 | err = -1; 68 | unlockfile(rndlock); 69 | RAND_cleanup(); 70 | return (err); 71 | } 72 | 73 | int rnd_add(byte *b, int l) 74 | { 75 | RAND_seed(b, l); 76 | return (0); 77 | } 78 | #endif /* USE_OPENSSL */ 79 | 80 | void rnd_time(void) 81 | { 82 | int pid; 83 | 84 | #ifdef WIN32 85 | SYSTEMTIME t; 86 | #endif /* WIN32 */ 87 | 88 | #ifdef HAVE_GETTIMEOFDAY 89 | struct timeval tv; 90 | 91 | gettimeofday(&tv, 0); 92 | rnd_add((byte *) &tv, sizeof(tv)); 93 | #elif defined(WIN32) /* end of HAVE_GETTIMEOFDAY */ 94 | GetSystemTime(&t); 95 | rnd_add((byte *) &t, sizeof(t)); 96 | #else /* end of defined(WIN32) */ 97 | rnd_add((byte *) time(NULL), sizeof(time_t)); 98 | #endif /* else if not defined(WIN32), HAVE_GETTIMEOFDAY */ 99 | pid = getpid(); 100 | rnd_add((byte *) &pid, sizeof(pid)); 101 | } 102 | 103 | void rnd_update(byte *seed, int l) 104 | { 105 | int fd = -1; 106 | byte b[512]; 107 | 108 | rnd_time(); 109 | if (seed) 110 | rnd_add(seed, l); 111 | #ifdef DEV_URANDOM 112 | fd = open(DEV_URANDOM, O_RDONLY); 113 | if (fd != -1) { 114 | ssize_t ret; 115 | 116 | ret = read(fd, b, sizeof(b)); 117 | if (ret > 0) { 118 | rnd_add(b, ret); 119 | } 120 | close(fd); 121 | } 122 | #endif /* DEV_URANDOM */ 123 | } 124 | 125 | int rnd_bytes(byte *b, int n) 126 | { 127 | /* we frequently need to get small amounts of random data. 128 | speed up by pre-generating dating data */ 129 | 130 | static byte rand[BUFSIZE]; 131 | static int idx = BUFSIZE; 132 | 133 | if (rnd_state != RND_SEEDED) 134 | rnd_error(); 135 | 136 | if (n + idx < BUFSIZE) { 137 | memcpy(b, rand + idx, n); 138 | idx += n; 139 | } else { 140 | if (1!=RAND_bytes(b, n)) errlog(WARNING, "deficient randomness while filling buffer\n"); 141 | } 142 | 143 | if (idx + 256 > BUFSIZE) { 144 | if (1!=RAND_bytes(rand, BUFSIZE)) errlog(WARNING, "deficient randomness while filling static cache\n"); 145 | idx = 0; 146 | } 147 | return (0); 148 | } 149 | 150 | int rnd_number(int n) 151 | { 152 | int r; 153 | 154 | assert(n > 0); 155 | if (n > 65535) 156 | do 157 | r = rnd_byte() * 65536 + 158 | rnd_byte() * 256 + rnd_byte(); 159 | while (r >= n); 160 | else if (n > 255) 161 | do 162 | r = rnd_byte() * 256 + rnd_byte(); 163 | while (r >= n); 164 | else 165 | do 166 | r = rnd_byte(); 167 | while (r >= n); 168 | return r; 169 | } 170 | 171 | byte rnd_byte() 172 | { 173 | byte b; 174 | 175 | rnd_bytes(&b, 1); 176 | return b; 177 | } 178 | 179 | void rnd_initialized(void) 180 | { 181 | rnd_state = RND_SEEDED; 182 | } 183 | 184 | #ifdef WIN32 185 | 186 | #define NEEDED 256 187 | 188 | int rnd_mouse(UINT i, WPARAM w, LPARAM l) 189 | { 190 | static int entropy = 0; 191 | static int x, y, dx, dy; 192 | int newx, newy, newdx, newdy; 193 | int rnd[4]; 194 | 195 | if (i == WM_MOUSEMOVE) { 196 | newx = LOWORD(l); 197 | newy = HIWORD(l); 198 | newdx = x - newx; 199 | newdy = y - newy; 200 | if (dx != 0 && dy != 0 && dx - newdx != 0 && dy - newdy != 0) { 201 | entropy++; 202 | if (entropy >= NEEDED) 203 | rnd_state = RND_SEEDED; 204 | } 205 | x = newx, y = newy, dx = newdx, dy = newdy; 206 | rnd[0] = x; rnd[1] = y; rnd[2] = dx; rnd[3] = dy; 207 | rnd_update((byte*)rnd, 4 * sizeof(int)); 208 | } 209 | return (rnd_state == RND_SEEDED ? 100 : entropy * 100 / NEEDED); 210 | } 211 | #endif /* WIN32 */ 212 | -------------------------------------------------------------------------------- /Src/compress.c: -------------------------------------------------------------------------------- 1 | /* Mixmaster version 3.1 -- (C) 1999 - 2016 Anonymizer Inc. and others. 2 | 3 | Mixmaster may be redistributed and modified under certain conditions. 4 | This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 5 | ANY KIND, either express or implied. See the file COPYRIGHT for 6 | details. 7 | 8 | Buffer compression (interface to zlib) 9 | $Id$ */ 10 | 11 | 12 | #include "mix3.h" 13 | #include 14 | #include 15 | 16 | static byte gz_magic[2] = 17 | {0x1f, 0x8b}; /* gzip magic header */ 18 | 19 | /* gzip flag byte */ 20 | #define ASCII_FLAG 0x01 21 | #define HEAD_CRC 0x02 22 | #define EXTRA_FIELD 0x04 23 | #define ORIG_NAME 0x08 24 | #define COMMENT 0x10 25 | #define RESERVED 0xE0 26 | #define Z_DEFLATED 8 27 | 28 | #ifdef USE_ZLIB 29 | #include "zlib.h" 30 | 31 | int buf_unzip(BUFFER *in, int type) 32 | { 33 | BUFFER *out; 34 | z_stream s; 35 | long outstart; 36 | int err; 37 | int ret = 0; 38 | 39 | out = buf_new(); 40 | 41 | s.zalloc = (alloc_func) 0; 42 | s.zfree = (free_func) 0; 43 | s.opaque = (voidpf) 0; 44 | 45 | s.next_in = in->data + in->ptr; 46 | s.avail_in = in->length + 1 - in->ptr; /* terminating 0 byte as "dummy" */ 47 | s.next_out = NULL; 48 | 49 | if (type == 1) 50 | err = inflateInit(&s); /* zlib */ 51 | else 52 | err = inflateInit2(&s, -MAX_WBITS); 53 | if (err != Z_OK) { 54 | ret = -1; 55 | goto end; 56 | } 57 | outstart = 0; 58 | buf_append(out, NULL, in->length * 15 / 10); 59 | 60 | for (;;) { 61 | s.next_out = out->data + s.total_out + outstart; 62 | s.avail_out = out->length - outstart - s.total_out; 63 | err = inflate(&s, Z_PARTIAL_FLUSH); 64 | out->length -= s.avail_out; 65 | if (err != Z_OK) 66 | break; 67 | buf_append(out, NULL, BUFSIZE); 68 | } 69 | if (err != Z_STREAM_END) 70 | errlog(WARNING, "Decompression error %d\n", err); 71 | 72 | err = inflateEnd(&s); 73 | if (err != Z_OK) 74 | ret = -1; 75 | end: 76 | if (ret != 0) 77 | switch (err) { 78 | case Z_STREAM_ERROR: 79 | errlog(ERRORMSG, "Decompression error Z_STREAM_ERROR.\n", err); 80 | break; 81 | case Z_MEM_ERROR: 82 | errlog(ERRORMSG, "Decompression error Z_MEM_ERROR.\n", err); 83 | break; 84 | case Z_BUF_ERROR: 85 | errlog(ERRORMSG, "Decompression error Z_BUF_ERROR.\n", err); 86 | break; 87 | case Z_VERSION_ERROR: 88 | errlog(ERRORMSG, "Decompression error Z_VERSION_ERROR.\n", err); 89 | break; 90 | default: 91 | errlog(ERRORMSG, "Decompression error %d.\n", err); 92 | } 93 | buf_move(in, out); 94 | buf_free(out); 95 | return (ret); 96 | } 97 | 98 | int buf_zip(BUFFER *out, BUFFER *in, int bits) 99 | { 100 | z_stream s; 101 | long outstart; 102 | int err = -1; 103 | 104 | assert(in != out); 105 | 106 | s.zalloc = (alloc_func) 0; 107 | s.zfree = (free_func) 0; 108 | s.opaque = (voidpf) 0; 109 | s.next_in = NULL; 110 | 111 | if (bits == 0) 112 | bits = MAX_WBITS; 113 | 114 | if (deflateInit2(&s, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -bits, 8, 0) != Z_OK) 115 | goto end; 116 | 117 | outstart = out->length; 118 | /* 12 is overhead, 1.01 is maximum expansion, and 1 is there to force a round-up */ 119 | buf_append(out, NULL, (int)13+in->length*1.01); /* fit it in one chunk */ 120 | 121 | s.next_in = in->data; 122 | s.avail_in = in->length; 123 | 124 | for (;;) { 125 | s.next_out = out->data + s.total_out + outstart; 126 | s.avail_out = out->length - outstart - s.total_out; 127 | err = deflate(&s, Z_FINISH); 128 | out->length -= s.avail_out; 129 | if (err != Z_OK) 130 | break; 131 | errlog(ERRORMSG, "Compressed data did not fit in one chunk.\n"); 132 | buf_append(out, NULL, BUFSIZE); 133 | } 134 | if (deflateEnd(&s) != Z_OK || err != Z_STREAM_END) 135 | err = -1; 136 | else 137 | err = 0; 138 | end: 139 | if (err != 0) 140 | errlog(ERRORMSG, "Compression error.\n"); 141 | return (err); 142 | } 143 | 144 | #else /* end of USE_ZLIB */ 145 | int buf_zip(BUFFER *out, BUFFER *in, int bits) 146 | { 147 | return (-1); 148 | } 149 | 150 | int buf_unzip(BUFFER *b, int type) 151 | { 152 | errlog(ERRORMSG, "Can't uncompress: no zlib\n"); 153 | return (-1); 154 | } 155 | #endif /* else not USE_ZLIB */ 156 | 157 | int compressed(BUFFER *b) 158 | { 159 | return (b->length >= 10 && b->data[0] == gz_magic[0] && 160 | b->data[1] == gz_magic[1]); 161 | } 162 | 163 | int buf_uncompress(BUFFER *in) 164 | { 165 | int type; 166 | int err = -1; 167 | unsigned int len; 168 | 169 | if (!compressed(in)) 170 | return (0); 171 | type = in->data[3]; 172 | if (in->data[2] != Z_DEFLATED || (type & RESERVED) == 0) { 173 | in->ptr = 10; 174 | if ((type & EXTRA_FIELD) != 0) { 175 | len = buf_geti(in); 176 | in->ptr += len; 177 | } 178 | if ((type & ORIG_NAME) != 0) 179 | while (buf_getc(in) > 0) ; 180 | if ((type & COMMENT) != 0) 181 | while (buf_getc(in) > 0) ; 182 | if ((type & HEAD_CRC) != 0) 183 | buf_geti(in); 184 | err = buf_unzip(in, 0); 185 | } 186 | return (err); 187 | } 188 | 189 | int buf_compress(BUFFER *in) 190 | { 191 | BUFFER *out; 192 | int err; 193 | 194 | if (compressed(in)) 195 | return (0); 196 | 197 | out = buf_new(); 198 | buf_appendc(out, gz_magic[0]); 199 | buf_appendc(out, gz_magic[1]); 200 | buf_appendc(out, Z_DEFLATED); 201 | buf_appendc(out, 0); /* flags */ 202 | buf_appendl(out, 0); /* time */ 203 | buf_appendc(out, 0); /* xflags */ 204 | buf_appendc(out, 3); /* Unix */ 205 | err = buf_zip(out, in, 0); 206 | if (err == 0) 207 | buf_move(in, out); 208 | buf_free(out); 209 | return (err); 210 | } 211 | -------------------------------------------------------------------------------- /Src/mixlib.def: -------------------------------------------------------------------------------- 1 | LIBRARY MIXLIB 2 | 3 | DESCRIPTION 'Mixmaster MIXLIB.DLL - http://mixmaster.anonymizer.com' 4 | 5 | EXPORTS 6 | mix_init @1 7 | mix_exit @2 8 | buf_new @3 9 | buf_free @4 10 | buf_read @5 11 | buf_write @6 12 | mix_encrypt @7 13 | mix_decrypt @8 14 | mix_send @9 15 | mix_regular @10 16 | ; nym_config @11 17 | ; nym_encrypt @12 18 | ; nym_decrypt @13 19 | t1_decrypt @14 20 | t2_decrypt @15 21 | mix_pool @16 22 | pgp_encrypt @17 23 | pgp_mailenc @18 24 | pgp_decrypt @19 25 | pgp_keygen @20 26 | buf_reset @21 27 | buf_clear @22 28 | buf_eq @23 29 | buf_append @24 30 | buf_appendc @25 31 | buf_appends @26 32 | buf_appendf @27 33 | buf_sets @28 34 | buf_nl @29 35 | buf_cat @30 36 | buf_rest @31 37 | buf_set @32 38 | buf_move @33 39 | buf_appendrnd @34 40 | buf_setrnd @35 41 | buf_appendzero @36 42 | buf_appendi @37 43 | buf_appendi_lo @38 44 | buf_appendl @39 45 | buf_appendl_lo @40 46 | buf_prepare @41 47 | buf_getc @42 48 | buf_geti @43 49 | buf_geti_lo @44 50 | buf_getl @45 51 | buf_getl_lo @46 52 | buf_ungetc @47 53 | buf_appendb @48 54 | buf_getb @49 55 | buf_getline @50 56 | buf_lookahead @51 57 | buf_chop @52 58 | buf_getheader @53 59 | buf_rewind @54 60 | rnd_init @55 61 | streq @56 62 | strieq @57 63 | strleft @58 64 | strileft @59 65 | strfind @60 66 | strifind @61 67 | rfc822_addr @62 68 | rfc822_name @63 69 | mixfile @64 70 | mix_daemon @65 71 | mix_openfile @66 72 | sendmail @67 73 | encode @68 74 | decode @69 75 | hdr_encode @70 76 | mail_encode @71 77 | id_encode @72 78 | id_decode @73 79 | errlog @74 80 | keymgt @75 81 | menu_folder @76 82 | user_pass @77 83 | pop3get @78 84 | mix_configline @79 85 | rnd_time @80 86 | rnd_add @81 87 | rnd_update @82 88 | pool_read @83 89 | bufieq @84 90 | buf_appendheader @85 91 | attachfile @86 92 | rnd_initialized @87 93 | rnd_mouse @88 94 | user_delpass @89 95 | strcatn @90 96 | file_to_out @91 97 | is_nt_service @92 98 | set_nt_exit_event @93 99 | prepare_type2list @94 100 | NYMSECRING @95 101 | pgp_dearmor @96 102 | pgp_armor @97 103 | pgp_compress @98 104 | pgp_literal @99 105 | PGPSECRING @100 106 | PGPPUBRING @101 107 | VERBOSE @102 108 | pgp_signtxt @103 109 | pool_add @104 110 | getv2seckey @105 111 | pgpdb_getkey @106 112 | ENTEREDPASSPHRASE @107 113 | PASSPHRASE @108 114 | mix_config @109 115 | RATE @110 116 | SENDPOOLTIME @111 117 | CLIENTAUTOFLUSH @112 118 | redirect_message @113 119 | mix_check_timeskew @114 120 | MIXCONF @115 121 | menu_main @116 122 | 123 | ALLPINGERSFILE @117 ; // RTC 124 | ALLPINGERSURL @118 ; // RTC 125 | STATSSRC @119 ; // RTC 126 | download_stats @120 ; // RTC 127 | url_download @121 ; // RTC 128 | parse_yearmonthday @122 ; // RTC 129 | rnd_bytes @123 ; // RTC 130 | mix_version @124 ; // RTC 131 | mix_initex @125 ; // RTC 132 | -------------------------------------------------------------------------------- /conf/pgp.hlp: -------------------------------------------------------------------------------- 1 | You can use PGP to encrypt messages sent to this remailer if you for 2 | some reason are unable to use the Mixmaster client software. However, 3 | while PGP will securely encrypt the content of a message that you are 4 | sending to the remailer, submitting messages to the remailer that are 5 | merely PGP encrypted without the use of the Mixmaster client software 6 | greatly increases the risk of third parties being able to determine the 7 | identity of the sender (you). 8 | 9 | This remailer primarily supports the ability to submit messages for 10 | remailing without requiring the Mixmaster client software for backwards 11 | compatibility with older remailer client software. 12 | 13 | If you are able to use the Mixmaster software with your operating system 14 | (chances are you can), it is highly recommended that you use the 15 | Mixmaster client software instead. See the earlier section in this help 16 | file on how to obtain a copy of the Mixmaster client software. 17 | 18 | If you cannot use the Mixmaster software, want to use an anonymous 19 | remailer, and are willing to accept reduced security, you can do the 20 | following: 21 | 22 | Send email with Subject: remailer-key to <%RMA> to obtain 23 | a copy of the remailer's PGP key. 24 | 25 | Then do the following: 26 | 27 | 1) create a file containing your message 28 | 2) insert a BLANK LINE as the first line of the file 29 | 3) Insert a "::" as the second line of the file 30 | 4) Insert "Anon-To: final_recipient@destination_domain.com" as the 31 | third line of the file. 32 | 33 | At this time, the file should look as follows: 34 | 35 | ================================================================== 36 | 37 | :: 38 | Anon-To: final_recipient@destination_domain.com 39 | 40 | This is some anonymized email. 41 | ================================================================== 42 | 43 | 5) Now encrypt the file with the PGP key of this remailer. 44 | 45 | Finally, email the encrypted file to <%RMA> as 46 | shown in the example below. 47 | 48 | The line "Encrypted: PGP" instructs the remailer to decrypt the message 49 | and process its contents. 50 | 51 | ================================================================== 52 | From: remailer_user@sender_domain.com 53 | To: %RMA 54 | Subject: anonymous message 55 | 56 | :: 57 | Encrypted: PGP 58 | 59 | -----BEGIN PGP MESSAGE----- 60 | Version: 2.6.3i 61 | 62 | owE1jMsNwjAUBH3gZMk9PClnUoBPUANpwElW2OBPZD8H0gd1UCP2gduuNDNfIcSH 63 | T4zCbQmtlbzGFM9T0jSD7QVvEzaPcUlBSSWHQclbnR9YWJNp5BFSLdR9CijF3NGx 64 | ybry/1Rsqn4la3a0JiIhLvnYGCu9HFtiC8oIxnlkeuIYe+EH =HgDq 65 | -----END PGP MESSAGE----- 66 | ================================================================== 67 | 68 | Even though PGP encryption in itself is very secure, not using the 69 | Mixmaster client exposes some information to parties desiring to 70 | compromise your privacy. This information leakage permits what is known 71 | as "traffic analysis". For example, if someone receives anonymous 72 | messages soon after you sent encrypted messages to a remailer it is 73 | likely that you are the sender of those messages. 74 | 75 | To partially compensate for this information leak, you can instruct the 76 | remailer to delay your messages for some time or send the remailer empty 77 | messages to make such analysis harder: 78 | 79 | If you use the line "Null:" instead of "Anon-To:", the remailer will 80 | simply discard your message. 81 | 82 | You can add a "Latent-Time:" header to the remailer to retain your 83 | message for some time before forwarding it. "Latent-Time: +2:00" would 84 | delay the message for two hours. You can use a random delay by adding 85 | "r", for example "Latent-Time: +5:00r" would delay the message for up to 86 | five hours. For example: 87 | 88 | ================================================================== 89 | 90 | :: 91 | Anon-To: final_recipient@destination_domain.com 92 | Latent-Time: +2:00 93 | 94 | This is some anonymized email. 95 | ================================================================== 96 | 97 | 98 | You can chain remailers by using another remailer to send the message to 99 | <%RMA> anonymously. For example, take the message 100 | 101 | ================================================================== 102 | 103 | :: 104 | Anon-To: %RMA 105 | 106 | :: 107 | Encrypted: PGP 108 | 109 | -----BEGIN PGP MESSAGE----- 110 | Version: 2.6.3i 111 | 112 | owE1jMsNwjAUBH3gZMk9PClnUoBPUANpwElW2OBPZD8H0gd1UCP2gduuNDNfIcSH 113 | T4zCbQmtlbzGFM9T0jSD7QVvEzaPcUlBSSWHQclbnR9YWJNp5BFSLdR9CijF3NGx 114 | ybry/1Rsqn4la3a0JiIhLvnYGCu9HFtiC8oIxnlkeuIYe+EH =HgDq 115 | -----END PGP MESSAGE----- 116 | ================================================================== 117 | 118 | Next, encrypt the message with the PGP key of the %RMN 119 | and send the twice-encrypted message to <%RMA>. 120 | 121 | Similar to a nested Russian matryoshka doll, containing increasingly 122 | smaller dolls inside the each outer doll, you can layer multiple 123 | encryption layers and remailer hops around your message. If this sounds 124 | confusing, just use the Mixmaster client software instead. 125 | 126 | If you send your messages through a chain of several independent 127 | remailers, it will be become increasingly difficult, though not 128 | necessarily impossible, to trace the anonymous message back to you. A 129 | vastly more secure solution is to use the Mixmaster client software to 130 | send your anonymous mail. 131 | 132 | Some remailers supporting PGP encrypted messages offer pseudonymous 133 | "nym" service that allow you to not only send emails privately, but also 134 | receive emails without enabling the sender to determine your recipient 135 | destination email address. For more information about such nym services, 136 | see the following URLs. 137 | 138 | http://lexx.shinn.net/nym/ 139 | 140 | http://riot.eu.org/anon/doc/nym.html 141 | 142 | ***** 143 | 144 | -------------------------------------------------------------------------------- /conf/pgponly.hlp: -------------------------------------------------------------------------------- 1 | You can use PGP to encrypt messages sent to this remailer if you for 2 | some reason are unable to use the Mixmaster client software. However, 3 | while PGP will securely encrypt the content of a message that you are 4 | sending to the remailer, submitting messages to the remailer that are 5 | merely PGP encrypted without the use of the Mixmaster client software 6 | greatly increases the risk of third parties being able to determine the 7 | identity of the sender (you). 8 | 9 | This remailer primarily supports the ability to submit messages for 10 | remailing without requiring the Mixmaster client software for backwards 11 | compatibility with older remailer client software. 12 | 13 | If you are able to use the Mixmaster software with your operating system 14 | (chances are you can), it is highly recommended that you use the 15 | Mixmaster client software instead. See the earlier section in this help 16 | file on how to obtain a copy of the Mixmaster client software. 17 | 18 | If you cannot use the Mixmaster software, want to use an anonymous 19 | remailer, and are willing to accept reduced security, you can do the 20 | following: 21 | 22 | Send email with Subject: remailer-key to <%RMA> to obtain 23 | a copy of the remailer's PGP key. 24 | 25 | Then do the following: 26 | 27 | 1) create a file containing your message 28 | 2) insert a BLANK LINE as the first line of the file 29 | 3) Insert a "::" as the second line of the file 30 | 4) Insert "Anon-To: final_recipient@destination_domain.com" as the 31 | third line of the file. 32 | 33 | At this time, the file should look as follows: 34 | 35 | ================================================================== 36 | 37 | :: 38 | Anon-To: final_recipient@destination_domain.com 39 | 40 | This is some anonymized email. 41 | ================================================================== 42 | 43 | 5) Now encrypt the file with the PGP key of this remailer. 44 | 45 | Finally, email the encrypted file to <%RMA> as 46 | shown in the example below. 47 | 48 | The line "Encrypted: PGP" instructs the remailer to decrypt the message 49 | and process its contents. 50 | 51 | ================================================================== 52 | From: remailer_user@sender_domain.com 53 | To: %RMA 54 | Subject: anonymous message 55 | 56 | :: 57 | Encrypted: PGP 58 | 59 | -----BEGIN PGP MESSAGE----- 60 | Version: 2.6.3i 61 | 62 | owE1jMsNwjAUBH3gZMk9PClnUoBPUANpwElW2OBPZD8H0gd1UCP2gduuNDNfIcSH 63 | T4zCbQmtlbzGFM9T0jSD7QVvEzaPcUlBSSWHQclbnR9YWJNp5BFSLdR9CijF3NGx 64 | ybry/1Rsqn4la3a0JiIhLvnYGCu9HFtiC8oIxnlkeuIYe+EH =HgDq 65 | -----END PGP MESSAGE----- 66 | ================================================================== 67 | 68 | Even though PGP encryption in itself is very secure, not using the 69 | Mixmaster client exposes some information to parties desiring to 70 | compromise your privacy. This information leakage permits what is known 71 | as "traffic analysis". For example, if someone receives anonymous 72 | messages soon after you sent encrypted messages to a remailer it is 73 | likely that you are the sender of those messages. 74 | 75 | To partially compensate for this information leak, you can instruct the 76 | remailer to delay your messages for some time or send the remailer empty 77 | messages to make such analysis harder: 78 | 79 | If you use the line "Null:" instead of "Anon-To:", the remailer will 80 | simply discard your message. 81 | 82 | You can add a "Latent-Time:" header to the remailer to retain your 83 | message for some time before forwarding it. "Latent-Time: +2:00" would 84 | delay the message for two hours. You can use a random delay by adding 85 | "r", for example "Latent-Time: +5:00r" would delay the message for up to 86 | five hours. For example: 87 | 88 | ================================================================== 89 | 90 | :: 91 | Anon-To: final_recipient@destination_domain.com 92 | Latent-Time: +2:00 93 | 94 | This is some anonymized email. 95 | ================================================================== 96 | 97 | 98 | You can chain remailers by using another remailer to send the message to 99 | <%RMA> anonymously. For example, take the message 100 | 101 | ================================================================== 102 | 103 | :: 104 | Anon-To: %RMA 105 | 106 | :: 107 | Encrypted: PGP 108 | 109 | -----BEGIN PGP MESSAGE----- 110 | Version: 2.6.3i 111 | 112 | owE1jMsNwjAUBH3gZMk9PClnUoBPUANpwElW2OBPZD8H0gd1UCP2gduuNDNfIcSH 113 | T4zCbQmtlbzGFM9T0jSD7QVvEzaPcUlBSSWHQclbnR9YWJNp5BFSLdR9CijF3NGx 114 | ybry/1Rsqn4la3a0JiIhLvnYGCu9HFtiC8oIxnlkeuIYe+EH =HgDq 115 | -----END PGP MESSAGE----- 116 | ================================================================== 117 | 118 | Next, encrypt the message with the PGP key of the %RMN 119 | and send the twice-encrypted message to <%RMA>. 120 | 121 | Similar to a nested Russian matryoshka doll, containing increasingly 122 | smaller dolls inside the each outer doll, you can layer multiple 123 | encryption layers and remailer hops around your message. If this sounds 124 | confusing, just use the Mixmaster client software instead. 125 | 126 | If you send your messages through a chain of several independent 127 | remailers, it will be become increasingly difficult, though not 128 | necessarily impossible, to trace the anonymous message back to you. A 129 | vastly more secure solution is to use the Mixmaster client software to 130 | send your anonymous mail. 131 | 132 | Some remailers supporting PGP encrypted messages offer pseudonymous 133 | "nym" service that allow you to not only send emails privately, but also 134 | receive emails without enabling the sender to determine your recipient 135 | destination email address. For more information about such nym services, 136 | see the following URLs. 137 | 138 | http://lexx.shinn.net/nym/ 139 | 140 | http://riot.eu.org/anon/doc/nym.html 141 | 142 | ***** 143 | 144 | 145 | -------------------------------------------------------------------------------- /win32/mix.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 11 | 12 | 13 | 21 | 36 | 38 | 46 | 54 | 56 | 58 | 60 | 64 | 66 | 68 | 70 | 72 | 74 | 75 | 83 | 99 | 101 | 109 | 117 | 119 | 121 | 123 | 127 | 129 | 131 | 133 | 135 | 137 | 138 | 139 | 140 | 141 | 142 | 145 | 147 | 149 | 153 | 154 | 156 | 161 | 162 | 163 | 165 | 167 | 171 | 172 | 174 | 179 | 180 | 181 | 182 | 185 | 186 | 189 | 190 | 191 | 192 | 193 | 194 | -------------------------------------------------------------------------------- /win32/zlib.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 11 | 12 | 13 | 21 | 35 | 37 | 41 | 43 | 45 | 47 | 49 | 53 | 55 | 57 | 59 | 61 | 62 | 63 | 64 | 65 | 66 | 69 | 71 | 73 | 77 | 78 | 79 | 81 | 83 | 87 | 88 | 89 | 91 | 93 | 97 | 98 | 99 | 101 | 103 | 107 | 108 | 109 | 111 | 113 | 117 | 118 | 119 | 121 | 123 | 127 | 128 | 129 | 131 | 133 | 137 | 138 | 139 | 141 | 143 | 147 | 148 | 149 | 151 | 153 | 157 | 158 | 159 | 161 | 163 | 167 | 168 | 169 | 171 | 173 | 177 | 178 | 179 | 181 | 183 | 187 | 188 | 189 | 191 | 193 | 197 | 198 | 199 | 201 | 203 | 207 | 208 | 209 | 210 | 213 | 214 | 215 | 216 | 217 | 218 | -------------------------------------------------------------------------------- /conf/mix.cfg.ex: -------------------------------------------------------------------------------- 1 | ## mix.cfg - Mixmaster configuration file 2 | ## see mixmaster(1) for a description 3 | ## 4 | ## All paths relative to compile-time defined SPOOL (default: ~/Mix) 5 | ## Can be overriden by environment variable $MIXPATH 6 | ## 7 | ## $Id: mix.cfg.ex,v 1.4 2003/09/03 16:46:04 packbart Exp $ 8 | 9 | ####################### Remailer configuration: ########################### 10 | 11 | ## Enable remailer functionality 12 | REMAIL y 13 | 14 | SHORTNAME foo 15 | REMAILERNAME Anonymous Remailer 16 | REMAILERADDR mix@example.net 17 | ANONNAME Anonymous 18 | #ANONADDR nobody@example.net 19 | #COMPLAINTS abuse@example.net 20 | 21 | ## Additional capstring flags (e.g.: testing filter mon) 22 | #EXTFLAGS testing 23 | 24 | ## Act as an intermediate hop only, forward anonymized messages to 25 | ## another remailer 26 | MIDDLEMAN n 27 | 28 | ## Supported formats: 29 | MIX y 30 | PGP n 31 | UNENCRYPTED n 32 | 33 | ## Only disable these if you really know what they do 34 | #REMIX y 35 | #REPGP y 36 | 37 | ## In middleman mode, mail is randhopped through this chain 38 | #FORWARDTO * 39 | 40 | ## Filter binaries and replace them with "[...]" 41 | ## Note: destroys even PGP messages sometimes 42 | BINFILTER n 43 | 44 | ## Allow users to add their address to the dest.blk file by sending the 45 | ## remailer a message containing the line "destination-block" 46 | ## Note: as no challenge-response mechanisms are used (yet), 47 | ## attackers could dest-block arbitrary addresses 48 | AUTOBLOCK n 49 | 50 | ## Automatically respond to non-remailer mail and mail to COMPLAINTS address 51 | AUTOREPLY n 52 | 53 | ## List statistics on intermediate vs. final delivery in remailer-stats. 54 | STATSDETAILS y 55 | 56 | ## List known remailers and their keys in remailer-conf reply 57 | LISTSUPPORTED y 58 | 59 | ## Maximum chain length for message forwarding requested by 60 | ## Rand-Hop and Remix-To directives 61 | MAXRANDHOPS 5 62 | 63 | ## Maximum size for Inflate: padding in kB. 0 means padding is not allowed 64 | INFLATEMAX 50 65 | 66 | ## Limits the number of allowed recipients in outgoing mail 67 | ## Anything that exceeds this number is dropped silently 68 | MAXRECIPIENTS 5 69 | 70 | ## Passphrase to protect secret keys 71 | #PASSPHRASE raboof 72 | 73 | ## Maximum message size in kB (0 for no limit): 74 | SIZELIMIT 0 75 | 76 | ## Remailing strategy: 77 | MAILINTIME 5m 78 | SENDPOOLTIME 15m 79 | POOLSIZE 45 80 | RATE 65 81 | 82 | ## Dummy generation probabilities 83 | INDUMMYP 10 84 | OUTDUMMYP 90 85 | 86 | ## How long to store packet IDs and incomplete message parts 87 | IDEXP 7d 88 | PACKETEXP 7d 89 | 90 | ## Client settings for Rand-Hop: directives and dummy messages 91 | CHAIN *,*,*,* 92 | DISTANCE 2 93 | MINREL 98 94 | RELFINAL 99 95 | MAXLAT 36h 96 | MINLAT 5m 97 | 98 | ## This file lists remailers which should not be used in randomly generated 99 | ## remailer chains 100 | STAREX starex.txt 101 | 102 | ## Path to inews, or address of mail-to-news gateway 103 | ## Leave empty to disable mix-post capability flag 104 | ## Add more mail2news gateways to increase posting reliability 105 | ## (and mail load on your MTA). Additional m2n include: 106 | ## mail2news@news.gradwell.net 107 | #NEWS mail2news@dizum.com,mail2news@m2n.mixmin.net 108 | ORGANIZATION Anonymous Posting Service 109 | 110 | ## Anti-spam message IDs on Usenet (MD5 of message body)? 111 | MID y 112 | 113 | ## Precedence: header to set on remailed messages 114 | #PRECEDENCE anon 115 | 116 | ## Enable either SENDMAIL/SENDANONMAIL (pipe into sendmail program) 117 | ## or SMTPRELAY (SMTP delivery over TCP) 118 | SENDMAIL /usr/lib/sendmail -t 119 | #SENDANONMAIL sendmessage.sh 120 | 121 | #SMTPRELAY smtp.example.net 122 | #SMTPUSERNAME foo 123 | #SMTPPASSWORD bar 124 | #HELONAME example.net 125 | #ENVFROM mix-bounce@example.net 126 | 127 | ## Where to log error messages: 128 | ERRLOG error.log 129 | VERBOSE 2 130 | 131 | ## Where to read mail messages from 132 | ## trailing "/" indicates maildir-style folder 133 | ## leave empty when you feed mixmaster through stdin (e.g. from procmail) 134 | #MAILIN /var/mail/mixmaster 135 | 136 | ## POP3 configuration 137 | POP3CONF pop3.cfg 138 | POP3TIME 1h 139 | POP3SIZELIMIT 0 140 | POP3DEL y 141 | 142 | ## Where to store non-remailed messages 143 | ## prefix with "|" to pipe into program 144 | ## treated as email address if it contains an "@" 145 | MAILBOX mbox 146 | #MAILABUSE mbox.abuse 147 | #MAILBLOCK mbox.block 148 | #MAILUSAGE /dev/null 149 | #MAILANON /dev/null 150 | #MAILERROR /dev/null 151 | #MAILBOUNCE mbox.bounce 152 | 153 | ## Where to find variable remailer keyrings and statistics 154 | PGPREMPUBASC pubring.asc 155 | PUBRING pubring.mix 156 | TYPE1LIST rlist.txt 157 | TYPE2REL mlist.txt 158 | TYPE2LIST type2.list 159 | 160 | ## If you run your own pinger, make stats/ a symlink to your results directory 161 | ## and enable these instead 162 | #PGPREMPUBASC stats/pgp-all.asc 163 | #PUBRING stats/pubring.mix 164 | #TYPE1LIST stats/rlist.txt 165 | #TYPE2REL stats/mlist.txt 166 | #TYPE2LIST stats/type2.list 167 | 168 | ## Where to find various textfiles 169 | DISCLAIMFILE disclaim.txt 170 | FROMDSCLFILE fromdscl.txt 171 | MSGFOOTERFILE footer.txt 172 | HELPFILE help.txt 173 | ADMKEY-FILE adminkey.txt 174 | ABUSEFILE abuse.txt 175 | REPLYFILE reply.txt 176 | USAGEFILE usage.txt 177 | BLOCKFILE blocked.txt 178 | 179 | ## List of blocked source addresses 180 | SOURCE-BLOCK source.blk 181 | 182 | ## List of unwanted header fields 183 | HDRFILTER header.blk 184 | 185 | ## List of blocked destination addresses 186 | DESTBLOCK dest.blk rab.blk 187 | 188 | ## List of addresses to which Mixmaster will deliver, even in middleman mode 189 | DESTALLOW dest.alw 190 | 191 | ## Pid file in daemon mode 192 | PIDFILE mixmaster.pid 193 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright (c) 1999-2000 Anonymizer Inc. 2 | Copyright (c) 2000-2002 Ulf Moeller 3 | Copyright (c) 2001-2002 Janis Jagars 4 | Copyright (c) 2001-2007 Peter Palfrader 5 | Copyright (c) 2001-2008 Len Sassaman 6 | Copyright (c) 2004-2008 Colin Tuckley 7 | Copyright (c) 2007-2008 Steve Crook 8 | 9 | 10 | MIXMASTER LICENSE AGREEMENT 11 | 12 | 1. Grant of License. 13 | 14 | Anonymizer Inc. grants you the following non-exclusive license for 15 | the Mixmaster program and its associated documentation (the "Program"), 16 | subject to all of the following terms and conditions: 17 | 18 | a) You may use the Program, and copy and distribute verbatim copies 19 | of the Program as you receive it, in any medium. 20 | 21 | Local regulations may exist which limit your rights to distribute or 22 | use cryptographic software. In certain jurisdictions, parts of this 23 | software may be protected by patents. It is your responsibility to 24 | obtain the appropriate licenses. 25 | 26 | b) You may modify the Program or incorporate the Program or any 27 | portion of it into other computer programs. You may copy and 28 | distribute such modifications or work, provided that you: 29 | 30 | (i) cause the modified Program to carry a prominent notice 31 | stating that it has been modified, and cause the modified files 32 | to carry notices stating that you changed the files and the 33 | date of any change; 34 | 35 | (ii) reproduce and include this Agreement, the copyright 36 | notices and disclaimer of warranty on any copy; and 37 | 38 | (iii) provide Anonymizer Inc. with a copy of the Source Code of 39 | such modifications or work via electronic mail to the address 40 | mixmaster@anonymizer.com, and grant Anonymizer Inc. a perpetual, 41 | royalty-free license to use and distribute the modifications or 42 | work in its products. 43 | 44 | "Source Code" means the preferred form of a work for making 45 | modifications to it, including all modules it contains, plus 46 | any associated interface definition files, scripts used to 47 | control compilation and installation of an executable. 48 | 49 | c) Should Anonymizer Inc. be acquired by another entity, you: 50 | 51 | (i) will grant to the acquiring entity the items in section 52 | 1.b.(iii) in leiu of Anonymizer, Inc.; 53 | 54 | d) Should Anonymizer Inc. cease to exist, and no aquiring entity be 55 | available to accept Source Code modifications, you: 56 | 57 | (i) will grant Lance Cottrell the items in section 1.b.(iii) in leiu 58 | of Anonymizer, Inc. 59 | 60 | (ii) should Mr. Cottrell be deceased, section 1.b.(iii) of this 61 | license will be rendered null and void. 62 | 63 | e) In the case that the electronic mail address mixmaster@anonymizer.com 64 | ceases to accept electronic mail, 65 | 66 | (i) submission of changes to the Mixmaster project at SourceForge 67 | will be accceptable; 68 | 69 | (ii) if Mixmaster development is no longer hosted by SourceForge, 70 | submission of changes to any open source repository similar to 71 | SourceForge, or 72 | 73 | (iii) submission to the Internet news group alt.privacy.anon-server 74 | will be acceptable. 75 | 76 | f) Submission of changes is required as a "best effort". If it is not 77 | possible for you to access any of the notification locations, a notation 78 | in the modified code stating that the modifications should be submitted by 79 | any capable parties who subsequently make use of the modified code will 80 | be acceptable in lieu of code submission. 81 | 82 | 2. Reservation of Rights. 83 | 84 | No rights are granted to the Program except as expressly set forth 85 | herein. You may not copy, modify, sublicense, or distribute the 86 | Program except as expressly provided under this Agreement. Any 87 | attempt otherwise to copy, modify, sublicense or distribute the 88 | Program is void, and will automatically terminate your rights under 89 | this Agreement. 90 | 91 | 3. DISCLAIMER OF WARRANTY. 92 | 93 | BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 94 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. THE 95 | PROGRAM IS PROVIDED ON AN ``AS IS'' BASIS, WITHOUT WARRANTY OF ANY 96 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, 97 | WARRANTIES THAT THE PROGRAM IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR 98 | A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE 99 | QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 100 | PROGRAM PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT ANONYMIZER INC. OR 101 | ANY DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY 102 | NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF 103 | WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF THE 104 | PROGRAM IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 105 | 106 | 4. LIMITATION OF LIABILITY. 107 | 108 | UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT 109 | (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL ANONYMIZER INC. 110 | OR ANY DEVELOPER OR ANY OTHER CONTRIBUTOR OR ANY SUPPLIER OF ANY OF 111 | SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY INDIRECT, 112 | SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER 113 | INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK 114 | STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER 115 | COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN 116 | INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF 117 | LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY 118 | RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW 119 | PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE 120 | EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO 121 | THAT EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. 122 | 123 | 5. General. 124 | 125 | This license represents the complete agreement concerning subject 126 | matter hereof. If any provision of this Agreement is held to be 127 | unenforceable, such provision shall be reformed only to the extent 128 | necessary to make it enforceable. This Agreement shall be governed by 129 | California law provisions (except to the extent applicable law, if 130 | any, provides otherwise), excluding its conflict-of-law provisions. 131 | The application of the United Nations Convention on Contracts for the 132 | International Sale of Goods is expressly excluded. Any law or 133 | regulation which provides that the language of a contract shall be 134 | construed against the drafter shall not apply to this License. 135 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Copyright (c) 1999-2000 Anonymizer Inc. 2 | Copyright (c) 2000-2002 Ulf Moeller 3 | Copyright (c) 2001-2002 Janis Jagars 4 | Copyright (c) 2001-2007 Peter Palfrader 5 | Copyright (c) 2001-2008 Len Sassaman 6 | Copyright (c) 2004-2008 Colin Tuckley 7 | Copyright (c) 2007-2008 Steve Crook 8 | 9 | 10 | MIXMASTER LICENSE AGREEMENT 11 | 12 | 1. Grant of License. 13 | 14 | Anonymizer Inc. grants you the following non-exclusive license for 15 | the Mixmaster program and its associated documentation (the "Program"), 16 | subject to all of the following terms and conditions: 17 | 18 | a) You may use the Program, and copy and distribute verbatim copies 19 | of the Program as you receive it, in any medium. 20 | 21 | Local regulations may exist which limit your rights to distribute or 22 | use cryptographic software. In certain jurisdictions, parts of this 23 | software may be protected by patents. It is your responsibility to 24 | obtain the appropriate licenses. 25 | 26 | b) You may modify the Program or incorporate the Program or any 27 | portion of it into other computer programs. You may copy and 28 | distribute such modifications or work, provided that you: 29 | 30 | (i) cause the modified Program to carry a prominent notice 31 | stating that it has been modified, and cause the modified files 32 | to carry notices stating that you changed the files and the 33 | date of any change; 34 | 35 | (ii) reproduce and include this Agreement, the copyright 36 | notices and disclaimer of warranty on any copy; and 37 | 38 | (iii) provide Anonymizer Inc. with a copy of the Source Code of 39 | such modifications or work via electronic mail to the address 40 | mixmaster@anonymizer.com, and grant Anonymizer Inc. a perpetual, 41 | royalty-free license to use and distribute the modifications or 42 | work in its products. 43 | 44 | "Source Code" means the preferred form of a work for making 45 | modifications to it, including all modules it contains, plus 46 | any associated interface definition files, scripts used to 47 | control compilation and installation of an executable. 48 | 49 | c) Should Anonymizer Inc. be acquired by another entity, you: 50 | 51 | (i) will grant to the acquiring entity the items in section 52 | 1.b.(iii) in leiu of Anonymizer, Inc.; 53 | 54 | d) Should Anonymizer Inc. cease to exist, and no aquiring entity be 55 | available to accept Source Code modifications, you: 56 | 57 | (i) will grant Lance Cottrell the items in section 1.b.(iii) in leiu 58 | of Anonymizer, Inc. 59 | 60 | (ii) should Mr. Cottrell be deceased, section 1.b.(iii) of this 61 | license will be rendered null and void. 62 | 63 | e) In the case that the electronic mail address mixmaster@anonymizer.com 64 | ceases to accept electronic mail, 65 | 66 | (i) submission of changes to the Mixmaster project at SourceForge 67 | will be accceptable; 68 | 69 | (ii) if Mixmaster development is no longer hosted by SourceForge, 70 | submission of changes to any open source repository similar to 71 | SourceForge, or 72 | 73 | (iii) submission to the Internet news group alt.privacy.anon-server 74 | will be acceptable. 75 | 76 | f) Submission of changes is required as a "best effort". If it is not 77 | possible for you to access any of the notification locations, a notation 78 | in the modified code stating that the modifications should be submitted by 79 | any capable parties who subsequently make use of the modified code will 80 | be acceptable in lieu of code submission. 81 | 82 | 2. Reservation of Rights. 83 | 84 | No rights are granted to the Program except as expressly set forth 85 | herein. You may not copy, modify, sublicense, or distribute the 86 | Program except as expressly provided under this Agreement. Any 87 | attempt otherwise to copy, modify, sublicense or distribute the 88 | Program is void, and will automatically terminate your rights under 89 | this Agreement. 90 | 91 | 3. DISCLAIMER OF WARRANTY. 92 | 93 | BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 94 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. THE 95 | PROGRAM IS PROVIDED ON AN ``AS IS'' BASIS, WITHOUT WARRANTY OF ANY 96 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, 97 | WARRANTIES THAT THE PROGRAM IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR 98 | A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE 99 | QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 100 | PROGRAM PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT ANONYMIZER INC. OR 101 | ANY DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY 102 | NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF 103 | WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF THE 104 | PROGRAM IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 105 | 106 | 4. LIMITATION OF LIABILITY. 107 | 108 | UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT 109 | (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL ANONYMIZER INC. 110 | OR ANY DEVELOPER OR ANY OTHER CONTRIBUTOR OR ANY SUPPLIER OF ANY OF 111 | SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY INDIRECT, 112 | SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER 113 | INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK 114 | STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER 115 | COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN 116 | INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF 117 | LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY 118 | RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW 119 | PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE 120 | EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO 121 | THAT EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. 122 | 123 | 5. General. 124 | 125 | This license represents the complete agreement concerning subject 126 | matter hereof. If any provision of this Agreement is held to be 127 | unenforceable, such provision shall be reformed only to the extent 128 | necessary to make it enforceable. This Agreement shall be governed by 129 | California law provisions (except to the extent applicable law, if 130 | any, provides otherwise), excluding its conflict-of-law provisions. 131 | The application of the United Nations Convention on Contracts for the 132 | International Sale of Goods is expressly excluded. Any law or 133 | regulation which provides that the language of a contract shall be 134 | construed against the drafter shall not apply to this License. 135 | -------------------------------------------------------------------------------- /debian/mixmaster/usr/share/doc/mixmaster/copyright: -------------------------------------------------------------------------------- 1 | Copyright (c) 1999-2000 Anonymizer Inc. 2 | Copyright (c) 2000-2002 Ulf Moeller 3 | Copyright (c) 2001-2002 Janis Jagars 4 | Copyright (c) 2001-2007 Peter Palfrader 5 | Copyright (c) 2001-2008 Len Sassaman 6 | Copyright (c) 2004-2008 Colin Tuckley 7 | Copyright (c) 2007-2008 Steve Crook 8 | 9 | 10 | MIXMASTER LICENSE AGREEMENT 11 | 12 | 1. Grant of License. 13 | 14 | Anonymizer Inc. grants you the following non-exclusive license for 15 | the Mixmaster program and its associated documentation (the "Program"), 16 | subject to all of the following terms and conditions: 17 | 18 | a) You may use the Program, and copy and distribute verbatim copies 19 | of the Program as you receive it, in any medium. 20 | 21 | Local regulations may exist which limit your rights to distribute or 22 | use cryptographic software. In certain jurisdictions, parts of this 23 | software may be protected by patents. It is your responsibility to 24 | obtain the appropriate licenses. 25 | 26 | b) You may modify the Program or incorporate the Program or any 27 | portion of it into other computer programs. You may copy and 28 | distribute such modifications or work, provided that you: 29 | 30 | (i) cause the modified Program to carry a prominent notice 31 | stating that it has been modified, and cause the modified files 32 | to carry notices stating that you changed the files and the 33 | date of any change; 34 | 35 | (ii) reproduce and include this Agreement, the copyright 36 | notices and disclaimer of warranty on any copy; and 37 | 38 | (iii) provide Anonymizer Inc. with a copy of the Source Code of 39 | such modifications or work via electronic mail to the address 40 | mixmaster@anonymizer.com, and grant Anonymizer Inc. a perpetual, 41 | royalty-free license to use and distribute the modifications or 42 | work in its products. 43 | 44 | "Source Code" means the preferred form of a work for making 45 | modifications to it, including all modules it contains, plus 46 | any associated interface definition files, scripts used to 47 | control compilation and installation of an executable. 48 | 49 | c) Should Anonymizer Inc. be acquired by another entity, you: 50 | 51 | (i) will grant to the acquiring entity the items in section 52 | 1.b.(iii) in leiu of Anonymizer, Inc.; 53 | 54 | d) Should Anonymizer Inc. cease to exist, and no aquiring entity be 55 | available to accept Source Code modifications, you: 56 | 57 | (i) will grant Lance Cottrell the items in section 1.b.(iii) in leiu 58 | of Anonymizer, Inc. 59 | 60 | (ii) should Mr. Cottrell be deceased, section 1.b.(iii) of this 61 | license will be rendered null and void. 62 | 63 | e) In the case that the electronic mail address mixmaster@anonymizer.com 64 | ceases to accept electronic mail, 65 | 66 | (i) submission of changes to the Mixmaster project at SourceForge 67 | will be accceptable; 68 | 69 | (ii) if Mixmaster development is no longer hosted by SourceForge, 70 | submission of changes to any open source repository similar to 71 | SourceForge, or 72 | 73 | (iii) submission to the Internet news group alt.privacy.anon-server 74 | will be acceptable. 75 | 76 | f) Submission of changes is required as a "best effort". If it is not 77 | possible for you to access any of the notification locations, a notation 78 | in the modified code stating that the modifications should be submitted by 79 | any capable parties who subsequently make use of the modified code will 80 | be acceptable in lieu of code submission. 81 | 82 | 2. Reservation of Rights. 83 | 84 | No rights are granted to the Program except as expressly set forth 85 | herein. You may not copy, modify, sublicense, or distribute the 86 | Program except as expressly provided under this Agreement. Any 87 | attempt otherwise to copy, modify, sublicense or distribute the 88 | Program is void, and will automatically terminate your rights under 89 | this Agreement. 90 | 91 | 3. DISCLAIMER OF WARRANTY. 92 | 93 | BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 94 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. THE 95 | PROGRAM IS PROVIDED ON AN ``AS IS'' BASIS, WITHOUT WARRANTY OF ANY 96 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, 97 | WARRANTIES THAT THE PROGRAM IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR 98 | A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE 99 | QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 100 | PROGRAM PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT ANONYMIZER INC. OR 101 | ANY DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY 102 | NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF 103 | WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF THE 104 | PROGRAM IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 105 | 106 | 4. LIMITATION OF LIABILITY. 107 | 108 | UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT 109 | (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL ANONYMIZER INC. 110 | OR ANY DEVELOPER OR ANY OTHER CONTRIBUTOR OR ANY SUPPLIER OF ANY OF 111 | SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY INDIRECT, 112 | SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER 113 | INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK 114 | STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER 115 | COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN 116 | INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF 117 | LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY 118 | RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW 119 | PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE 120 | EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO 121 | THAT EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. 122 | 123 | 5. General. 124 | 125 | This license represents the complete agreement concerning subject 126 | matter hereof. If any provision of this Agreement is held to be 127 | unenforceable, such provision shall be reformed only to the extent 128 | necessary to make it enforceable. This Agreement shall be governed by 129 | California law provisions (except to the extent applicable law, if 130 | any, provides otherwise), excluding its conflict-of-law provisions. 131 | The application of the United Nations Convention on Contracts for the 132 | International Sale of Goods is expressly excluded. Any law or 133 | regulation which provides that the language of a contract shall be 134 | construed against the drafter shall not apply to this License. 135 | -------------------------------------------------------------------------------- /Src/pgp.h: -------------------------------------------------------------------------------- 1 | /* Mixmaster version 3.1 -- (C) 1999 - 2016 Anonymizer Inc. and others. 2 | 3 | Mixmaster may be redistributed and modified under certain conditions. 4 | This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 5 | ANY KIND, either express or implied. See the file COPYRIGHT for 6 | details. 7 | 8 | OpenPGP messages 9 | $Id$ */ 10 | 11 | 12 | #ifdef USE_PGP 13 | #ifndef _PGP_H 14 | #include "mix3.h" 15 | #ifdef USE_OPENSSL 16 | #include 17 | #endif /* USE_OPENSSL */ 18 | 19 | /* in the PGP Version header, list the same information as all other 20 | versions of Mixmaster to prevent anonymity set division. */ 21 | #define CLOAK 22 | 23 | /* try to make the messages look similar to PGP 2.6.3i output 24 | (compression is not always the same though). */ 25 | #define MIMIC 26 | 27 | /* packet types */ 28 | #define PGP_SESKEY 1 29 | #define PGP_SIG 2 30 | #define PGP_SYMSESKEY 3 31 | #define PGP_OSIG 4 32 | #define PGP_SECKEY 5 33 | #define PGP_PUBKEY 6 34 | #define PGP_SECSUBKEY 7 35 | #define PGP_COMPRESSED 8 36 | #define PGP_ENCRYPTED 9 37 | #define PGP_MARKER 10 38 | #define PGP_LITERAL 11 39 | #define PGP_TRUST 12 40 | #define PGP_USERID 13 41 | #define PGP_PUBSUBKEY 14 42 | #define PGP_ENCRYPTEDMDC 18 43 | #define PGP_MDC 19 44 | 45 | /* symmetric algorithms */ 46 | #define PGP_K_ANY 0 47 | #define PGP_K_IDEA 1 48 | #define PGP_K_3DES 2 49 | #define PGP_K_CAST5 3 50 | #define PGP_K_BF 4 51 | #define PGP_K_AES128 7 52 | #define PGP_K_AES192 8 53 | #define PGP_K_AES256 9 54 | 55 | /* hash algorithms */ 56 | #define PGP_H_MD5 1 57 | #define PGP_H_SHA1 2 58 | #define PGP_H_RIPEMD 3 59 | 60 | /* signature types */ 61 | #define PGP_SIG_BINARY 0 62 | #define PGP_SIG_CANONIC 1 63 | #define PGP_SIG_CERT 0x10 64 | #define PGP_SIG_CERT1 0x11 65 | #define PGP_SIG_CERT2 0x12 66 | #define PGP_SIG_CERT3 0x13 67 | #define isPGP_SIG_CERT(x) (x >= PGP_SIG_CERT && x <= PGP_SIG_CERT3) 68 | #define PGP_SIG_BINDSUBKEY 0x18 69 | #define PGP_SIG_KEYREVOKE 0x20 70 | #define PGP_SIG_SUBKEYREVOKE 0x28 71 | #define PGP_SIG_CERTREVOKE 0x30 72 | 73 | /* signature subpacket types */ 74 | #define PGP_SUB_CREATIME 2 75 | #define PGP_SUB_CERTEXPIRETIME 3 76 | #define PGP_SUB_KEYEXPIRETIME 9 77 | #define PGP_SUB_PSYMMETRIC 11 78 | #define PGP_SUB_ISSUER 16 79 | #define PGP_SUB_PRIMARY 25 80 | #define PGP_SUB_FEATURES 30 81 | 82 | #define ARMORED 1 83 | 84 | /* publick key algorithm operation modes */ 85 | 86 | #define PK_ENCRYPT 1 87 | #define PK_DECRYPT 2 88 | #define PK_SIGN 3 89 | #define PK_VERIFY 4 90 | 91 | #define MD5PREFIX "\x30\x20\x30\x0C\x06\x08\x2A\x86\x48\x86\xF7\x0D\x02\x05\x05\x00\x04\x10" 92 | #define SHA1PREFIX "\x30\x21\x30\x09\x06\x05\x2b\x0E\x03\x02\x1A\x05\x00\x04\x14" 93 | 94 | typedef struct { 95 | int ok; 96 | BUFFER *userid; 97 | byte sigtype; 98 | long sigtime; 99 | byte hash[16]; 100 | } pgpsig; 101 | 102 | /* internal error codes */ 103 | #define PGP_SIGVRFY 99 /* valid signature packet to be verified */ 104 | 105 | /* pgpdata.c */ 106 | int pgp_getsk(BUFFER *p, BUFFER *pass, BUFFER *key); 107 | int pgp_makesk(BUFFER *out, BUFFER *key, int sym, int type, int hash, 108 | BUFFER *pass); 109 | void pgp_iteratedsk(BUFFER *salted, BUFFER *salt, BUFFER *pass, byte c); 110 | int pgp_expandsk(BUFFER *key, int skalgo, int hashalgo, BUFFER *data); 111 | int skcrypt(BUFFER *data, int skalgo, BUFFER *key, BUFFER *iv, int enc); 112 | int mpi_get(BUFFER *buf, BUFFER *mpi); 113 | int mpi_put(BUFFER *buf, BUFFER *mpi); 114 | int pgp_rsa(BUFFER *buf, BUFFER *key, int mode); 115 | void pgp_sigcanonic(BUFFER *msg); 116 | int pgp_makepubkey(BUFFER *seckey, BUFFER *outtxt, BUFFER *pubkey, 117 | BUFFER *pass, int keyalgo); 118 | int pgp_makekeyheader(int type, BUFFER *keypacket, BUFFER *outtxt, 119 | BUFFER *pass, int keyalgo); 120 | int pgp_getkey(int mode, int algo, int *sym, int *mdc, long *expires, BUFFER *keypacket, BUFFER *key, 121 | BUFFER *keyid, BUFFER *userid, BUFFER *pass); 122 | int pgp_rsakeygen(int bits, BUFFER *userid, BUFFER *pass, char *pubring, 123 | char *secring, int remail); 124 | int pgp_dhkeygen(int bits, BUFFER *userid, BUFFER *pass, char *pubring, 125 | char *secring, int remail); 126 | int pgp_dosign(int algo, BUFFER *data, BUFFER *key); 127 | int pgp_elgencrypt(BUFFER *b, BUFFER *key); 128 | int pgp_elgdecrypt(BUFFER *b, BUFFER *key); 129 | int pgp_keyid(BUFFER *key, BUFFER *id); 130 | int pgp_keylen(int symalgo); 131 | int pgp_blocklen(int symalgo); 132 | 133 | /* pgpget.c */ 134 | int pgp_getmsg(BUFFER *in, BUFFER *key, BUFFER *sig, char *pubring, 135 | char *secring); 136 | int pgp_ispacket(BUFFER *buf); 137 | int pgp_isconventional(BUFFER *buf); 138 | int pgp_packettype(BUFFER *buf, long *len, int *partial); 139 | int pgp_packetpartial(BUFFER *buf, long *len, int *partial); 140 | int pgp_getpacket(BUFFER *buf, BUFFER *p); 141 | int pgp_getsig(BUFFER *p, pgpsig *sig, char *pubring); 142 | void pgp_verify(BUFFER *msg, BUFFER *detached, pgpsig *sig); 143 | int pgp_getsymmetric(BUFFER *buf, BUFFER *key, int algo, int type); 144 | int pgp_getliteral(BUFFER *buf); 145 | int pgp_uncompress(BUFFER *buf); 146 | int pgp_getsessionkey(BUFFER *buf, BUFFER *pass, char *secring); 147 | int pgp_getsymsessionkey(BUFFER *buf, BUFFER *pass); 148 | 149 | /* pgpcreat.c */ 150 | int pgp_packet(BUFFER *buf, int type); 151 | int pgp_packet3(BUFFER *buf, int type); 152 | int pgp_symmetric(BUFFER *buf, BUFFER *key, int mdc); 153 | int pgp_literal(BUFFER *buf, char *filename, int text); 154 | int pgp_compress(BUFFER *buf); 155 | int pgp_sessionkey(BUFFER *buf, BUFFER *user, BUFFER *keyid, BUFFER *seskey, 156 | char *pubring); 157 | void pgp_marker(BUFFER *buf); 158 | int pgp_symsessionkey(BUFFER *buf, BUFFER *seskey, BUFFER *pass); 159 | int pgp_sign(BUFFER *msg, BUFFER *msg2, BUFFER *sig, BUFFER *userid, 160 | BUFFER *pass, int type, int self, long now, int remail, 161 | BUFFER *seckey, char *secring); 162 | int pgp_digest(int hashalgo, BUFFER *in, BUFFER *d); 163 | 164 | /* pgpdb.c */ 165 | 166 | int pgpdb_getkey(int mode, int algo, int *sym, int *mdc, long *expires, BUFFER *key, BUFFER *user, 167 | BUFFER *founduid, BUFFER *keyid, char *keyring, BUFFER *pass); 168 | 169 | typedef struct { 170 | int filetype; 171 | BUFFER *db; 172 | LOCK *lock; 173 | int modified; 174 | int type; /* undefined, public, private */ 175 | char filename[LINELEN]; 176 | BUFFER *encryptkey; 177 | #ifdef DEBUG 178 | int writer; 179 | #endif 180 | } KEYRING; 181 | 182 | KEYRING *pgpdb_new(char *keyring, int filetype, BUFFER *encryptkey, int type); 183 | KEYRING *pgpdb_open(char *keyring, BUFFER *encryptkey, int writer, int type); 184 | int pgpdb_append(KEYRING *keydb, BUFFER *p); 185 | int pgpdb_getnext(KEYRING *keydb, BUFFER *p, BUFFER *keyid, BUFFER *userid); 186 | int pgpdb_close(KEYRING *keydb); 187 | 188 | #endif /* not _PGP_H */ 189 | #endif /* USE_PGP */ 190 | -------------------------------------------------------------------------------- /Src/mpgp.c: -------------------------------------------------------------------------------- 1 | /* mpgp -- (C) 2000 - 2006 Ulf Moeller and others. 2 | 3 | mpgp may be redistributed and modified under certain conditions. 4 | This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 5 | ANY KIND, either express or implied. See the file COPYRIGHT for 6 | details. 7 | 8 | Test application for OpenPGP features 9 | $Id$ */ 10 | 11 | #define MPGPVERSION "0.3.0" 12 | 13 | #include "mix3.h" 14 | #include "pgp.h" 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #ifdef POSIX 24 | #include 25 | #include 26 | #endif /* POSIX */ 27 | 28 | int pass(BUFFER *b) 29 | { 30 | char p[LINELEN]; 31 | int fd; 32 | int n; 33 | 34 | #ifdef HAVE_TERMIOS 35 | struct termios attr; 36 | #endif /* HAVE_TERMIOS */ 37 | 38 | fprintf(stderr, "enter passphrase: "); 39 | fflush(stderr); 40 | #ifdef HAVE_TERMIOS 41 | fd = open("/dev/tty", O_RDONLY); 42 | if (tcgetattr(fd, &attr) != 0) 43 | return (-1); 44 | attr.c_lflag &= ~ECHO; 45 | attr.c_lflag |= ICANON; 46 | if (tcsetattr(fd, TCSAFLUSH, &attr) != 0) 47 | return (-1); 48 | n = read(fd, p, LINELEN); 49 | 50 | attr.c_lflag |= ECHO; 51 | if (tcsetattr(fd, TCSAFLUSH, &attr) != 0) 52 | return (-1); 53 | close(fd); 54 | p[n - 1] = 0; 55 | 56 | #else /* end of HAVE_TERMIOS */ 57 | fgets(p, LINELEN, stdin); 58 | if (p[strlen(p)-1]=='\n') 59 | p[strlen(p)-1] = 0; 60 | #endif /* else if not HAVE_TERMIOS */ 61 | 62 | fprintf(stderr, "\n"); 63 | buf_appends(b, p); 64 | return (0); 65 | } 66 | 67 | void usage(char *n) 68 | { 69 | fprintf(stderr, "Usage: %s -e [-b] user@domain\n", n); 70 | fprintf(stderr, " %s -s [-b] [yourname@domain]\n", n); 71 | fprintf(stderr, " %s -c [-b]\n", n); 72 | fprintf(stderr, " %s -C [-b]\n", n); 73 | fprintf(stderr, " %s -d [passphrase]\n", n); 74 | fprintf(stderr, " %s -g[r] yourname@domain [bits]\n", n); 75 | fprintf(stderr, " %s -a[+-] [-b]\n", n); 76 | fprintf(stderr, " %s -V\n\n", n); 77 | fprintf(stderr, "PGP public key ring: %s\n", PGPPUBRING); 78 | fprintf(stderr, "PGP secret key ring: %s\n", PGPSECRING); 79 | } 80 | 81 | int decrypt(BUFFER *u, BUFFER *option, char *n) 82 | { 83 | BUFFER *v; 84 | BUFFER *sig; 85 | int err = 0; 86 | 87 | v = buf_new(); 88 | sig = buf_new(); 89 | 90 | buf_set(v, u); 91 | err = pgp_decrypt(v, NULL, sig, PGPPUBRING, PGPSECRING); 92 | if (err >= 0 || err == PGP_SIGBAD) 93 | buf_move(u, v); 94 | 95 | if (err == PGP_ERR) { 96 | pass(option); 97 | err = pgp_decrypt(u, option, sig, PGPPUBRING, PGPSECRING); 98 | } 99 | switch (err) { 100 | case PGP_NOMSG: 101 | fprintf(stderr, "%s: Not a PGP message.\n", n); 102 | break; 103 | case PGP_ERR: 104 | fprintf(stderr, "%s: Can't read message.\n", n); 105 | break; 106 | case PGP_SIGOK: 107 | fprintf(stderr, "%s: Valid signature: %s\n", n, sig->data); 108 | err = 0; 109 | break; 110 | case PGP_SIGNKEY: 111 | fprintf(stderr, "%s: Unknown signature key %s, cannot verify.\n", n, sig->data); 112 | err = 1; 113 | break; 114 | case PGP_SIGBAD: 115 | fprintf(stderr, "%s: Bad signature.\n", n); 116 | err = 1; 117 | break; 118 | } 119 | 120 | buf_free(v); 121 | buf_free(sig); 122 | 123 | return (err); 124 | } 125 | 126 | int main(int argc, char *argv[]) 127 | { 128 | BUFFER *u, *option, *pp; 129 | char *filename = NULL; 130 | char *cmd = NULL; 131 | int text = 1; 132 | int err = 99; 133 | int bits = 0; 134 | 135 | mix_init(NULL); 136 | VERBOSE = 3; 137 | 138 | u = buf_new(); 139 | option = buf_new(); 140 | pp = buf_new(); 141 | 142 | if (argc > 1 && argv[1][0] == '-') 143 | cmd = argv[1]; 144 | 145 | if (argc == 1 || (cmd > 0 && (cmd[1] == 'e' || cmd[1] == 'c' || 146 | cmd[1] == 'd' || cmd[1] == 'a' || 147 | cmd[1] == 's' || cmd[1] == 'C'))) { 148 | if ((argc > 2 && (cmd == NULL || cmd[1] == 'a')) || argc > 3) { 149 | FILE *f; 150 | 151 | f = fopen(argv[argc - 1], "rb"); 152 | if (f == NULL) { 153 | fprintf(stderr, "%s: Can't open %s\n", argv[0], argv[argc - 1]); 154 | err = -1; 155 | } else { 156 | buf_read(u, f); 157 | fclose(f); 158 | filename = argv[argc - 1]; 159 | argc--; 160 | } 161 | } else 162 | buf_read(u, stdin); 163 | } 164 | if (argc == 1) 165 | err = decrypt(u, option, argv[0]); 166 | 167 | if (argc > 2 && argv[2][0] == '-' && argv[2][1] == 'b') { 168 | text = 0; 169 | if (argc > 3) 170 | buf_appends(option, argv[3]); 171 | } else if (argc > 2) 172 | buf_appends(option, argv[2]); 173 | 174 | if (cmd) 175 | switch (cmd[1]) { 176 | case 's': 177 | err = pgp_encrypt(PGP_SIGN | (text ? PGP_TEXT : 0), u, NULL, option, 178 | NULL, PGPPUBRING, PGPSECRING); 179 | if (err != 0) { 180 | pass(pp); 181 | err = pgp_encrypt(PGP_SIGN | (text ? PGP_TEXT : 0), u, NULL, option, 182 | pp, PGPPUBRING, PGPSECRING); 183 | } 184 | if (err != 0) 185 | fprintf(stderr, "Error.\n"); 186 | break; 187 | case 'e': 188 | if (option->length) { 189 | err = pgp_encrypt(PGP_ENCRYPT | (text ? PGP_TEXT : 0), u, option, NULL, 190 | NULL, PGPPUBRING, PGPSECRING); 191 | if (err < 0) 192 | fprintf(stderr, "%s: can't encrypt message for %s\n", 193 | argv[0], argv[2]); 194 | } 195 | break; 196 | case 'c': 197 | pass(option); 198 | err = pgp_encrypt(PGP_CONVENTIONAL | (text ? PGP_TEXT : 0), u, option, 199 | NULL, NULL, PGPPUBRING, PGPSECRING); 200 | if (err < 0) 201 | fprintf(stderr, "%s: can't encrypt message\n", argv[0]); 202 | break; 203 | case 'C': 204 | pass(option); 205 | err = pgp_encrypt(PGP_NCONVENTIONAL | (text ? PGP_TEXT : 0), u, option, 206 | NULL, NULL, PGPPUBRING, PGPSECRING); 207 | if (err < 0) 208 | fprintf(stderr, "%s: can't encrypt message\n", argv[0]); 209 | break; 210 | case 'g': 211 | if (argc < 3) { 212 | err = 99; 213 | goto end; 214 | } 215 | pass(pp); 216 | if (argc == 4) 217 | sscanf(argv[3], "%d", &bits); 218 | err = pgp_keygen(cmd[2] == 'r' ? PGP_ES_RSA : PGP_E_ELG, 219 | bits, option, pp, PGPPUBRING, PGPSECRING, 0); 220 | break; 221 | case 'a': 222 | switch (cmd[2]) { 223 | case '-': 224 | err = pgp_dearmor(u, u); 225 | if (err == -1) 226 | fprintf(stderr, "Not a PGP-armored message\n"); 227 | goto end; 228 | case '+': 229 | break; 230 | default: 231 | pgp_literal(u, filename, text); 232 | pgp_compress(u); 233 | break; 234 | } 235 | err = pgp_armor(u, PGP_ARMOR_NORMAL); 236 | break; 237 | case 'd': 238 | err = decrypt(u, option, argv[0]); 239 | break; 240 | case 'h': 241 | usage(argv[0]); 242 | err = 0; 243 | break; 244 | case 'V': 245 | fprintf(stderr, "mpgp version %s\n", MPGPVERSION); 246 | fprintf(stderr, "(C) 2000 - 2004 Ulf Moeller and others.\n"); 247 | fprintf(stderr, "See the file COPYRIGHT for details.\n"); 248 | err = 0; 249 | break; 250 | } 251 | end: 252 | if (err == 99) 253 | usage(argv[0]); 254 | 255 | if (err >= 0) 256 | buf_write(u, stdout); 257 | 258 | buf_free(option); 259 | buf_free(pp); 260 | buf_free(u); 261 | 262 | mix_exit(); 263 | return (err == -1 ? 1 : err); 264 | } 265 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Mixmaster 3.1 -- anonymous remailer software -- (C) 1999 - 2000 Anonymizer Inc. 2 | (C) 2000-2016 The Mixmaster Development Team 3 | ------------------------------------------------------------------------------- 4 | 5 | This program consists of 6 | 7 | * a remailer client: 8 | 9 | The remailer client supports sending anonymous mail using Cypherpunk and 10 | Mixmaster remailers. It supports OpenPGP encryption (compatible with PGP 2, 11 | PGP 5 and up, and GnuPG). In fact we're getting doubtful about the range 12 | of compatibility now but GnuPG definitely works with most remailers. 13 | 14 | The client can be used with a menu-based user interface and with command line 15 | options. 16 | 17 | * a remailer: 18 | 19 | The remailer supports the Cypherpunk and Mixmaster message formats. It can 20 | be integrated with the mail delivery system of Unix-based computers or use 21 | the POP3 and SMTP protocols for mail transfer. Mixmaster includes an 22 | automated abuse-handling system. 23 | 24 | Please report any problems at alt.privacy.anon-server or 25 | https://github.com/merkinmuffley/mixmaster4096 26 | or remops (http://lists.mixmin.net/pipermail/remops/). 27 | 28 | 29 | Installation: 30 | ------------ 31 | 32 | Libraries: 33 | 34 | Mixmaster requires the libraries OpenSSL, zlib, and pcre. 35 | If libraries are provided by packages for your OS that's probably your best plan. 36 | If using Debian consult the file debian/control; the "Build-Depends" line. 37 | 38 | If you want to use the menu-based user interface, you also need the ncurses 39 | library. If these libraries are not installed on your system, you will need 40 | to obtain the latest versions from the sources below and extract them in the 41 | the Src/ directory first. 42 | 43 | OpenSSL is available from http://www.openssl.org/source/ 44 | 45 | Ncurses can be obtained from http://ftp.gnu.org/pub/gnu/ncurses/ 46 | 47 | The Perl Compatable Regular Expressions library can be obtained from 48 | ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ 49 | (Red Hat related systems such as CentOS may need the "pcre-devel" package.) 50 | 51 | The zlib compression libraries can be obtained from 52 | http://www.gzip.org/zlib/ 53 | 54 | To install or upgrade Mixmaster, type `./Install'. 55 | 56 | Mixmaster clients rely on pingers to compile statistics and keyrings for 57 | currently operating remailers. A list of public pingers can be obtained from 58 | http://www.noreply.org/allpingers/. 59 | 60 | Alternatively clients can operate their own pingers to generate statistics. 61 | Pinger software can be obtained from http://www.palfrader.org/echolot/. If you 62 | choose this option, please publish the pinger results for the benefit of other 63 | Mixmaster users and notify the metastats maintainer at admin@mixmin.net. 64 | 65 | The required files published by pingers are:- 66 | pubring.asc Type 1 remailer keys 67 | pubring.mix Type 2 remailer keys 68 | rlist.txt List of reliable type 1 remailers 69 | mlist.txt List of reliable type 2 remailers 70 | type2.list List of known type 2 remailers (optional) 71 | 72 | Using the remailer client: 73 | ------------------------- 74 | 75 | To use the menu-based user interface, simply run `mixmaster'. To send an 76 | anonymous or pseudonymous reply to a message from within your mail or news 77 | reader, you can pipe it to `mixmaster'. 78 | 79 | The interactive mode supports sending mail and contains a simple mail reading 80 | function. OpenPGP messages are encrypted and decrypted automatically. 81 | 82 | In the non-interactive mode, Mixmaster reads a message from a file or from its 83 | standard input. The command line options are described in the manual page 84 | (mixmaster.1). 85 | 86 | 87 | Mixmaster as a remailer: 88 | ----------------------- 89 | 90 | The Mixmaster remailer can be installed on any account that can receive mail. 91 | Non-remailer messages will be delivered as usual. If you have root access, you 92 | may want to create a new user (e.g., `remailer') and install Mixmaster under 93 | that user id. 94 | 95 | The Install script provides a simple way to set up the remailer. More 96 | information about configuring Mixmaster can be found in the manual page. 97 | Typically, incoming mail is piped to "mixmaster -RM". In a UUCP setting, it may 98 | be useful to use just "mixmaster -R", and run "mixmaster -S" once all messages 99 | have arrived. 100 | 101 | Announcing a new remailer to the public is most commonly done by posting the 102 | remailer keys and capabilities to alt.privacy.anon-server as well as the 103 | "remops" mailing list. Information about the remops list can be found here: 104 | http://lists.mixmin.net/mailman/listinfo/remops 105 | 106 | 107 | Installation problems: 108 | --------------------- 109 | 110 | In case one of the libraries Mixmaster uses is installed incorrectly on your 111 | system, place the library source code (available from the locations listed 112 | above) in the Src directory, remove the old Makefile, run the Install script 113 | again and answer `y' when asked whether to use the source code. 114 | 115 | The ncurses library can use termcap and terminfo databases. The Mixmaster 116 | Install script tries to find out whether terminfo is available. If you get a 117 | "Can't open display" error when starting the Mixmaster menu, run "./configure 118 | --enable-termcap; make lib/libncurses.a" in the ncurses directory. 119 | 120 | 121 | Security notes: 122 | -------------- 123 | 124 | The ciphers and the anonymizing mix-net protocol used in Mixmaster correspond 125 | to the state of the art (see the Security Considerations section of the 126 | Mixmaster Protocol specification for details). However, no security proofs 127 | exist for any practical cryptosystem. It is unlikely that their security will 128 | be broken, but there is no "perfect security". Software can also contain 129 | implementation errors. The complete Mixmaster source code is available for 130 | public review, so that everyone can verify what the program does, and it is 131 | unlikely that security related errors or secret back doors in the software 132 | would go unnoticed. 133 | 134 | No software is secure if run in an insecure environment. For that reason you 135 | must make sure that there is no malicious software (such as viruses) running on 136 | your computer. Deleted files and even passphrases can in many cases be read 137 | from the hard disk if an adversary has access to the computer. The use of disk 138 | encryption programs is recommended to avoid this risk. 139 | 140 | Anonymous messages are secure as long as at least one of the remailers you use 141 | in a chain is honest. You can use up to 20 remailers in a chain, but 142 | reliability and speed decrease with longer chains. Four is a reasonable number 143 | of remailers to use. Many remailer operators sign their keys. You should verify 144 | those signatures with OpenPGP to make sure that you have the actual remailer 145 | keys. 146 | 147 | Anonymous keys usually cannot be introduced to the OpenPGP web of trust without 148 | giving up anonymity. For that reason, this client will use any OpenPGP key 149 | found on the key ring, whether it is certified or not. Your key ring must not 150 | contain any invalid keys when used with this program. 151 | 152 | If you want to use a pseudonym, the client will ask you for a passphrase to 153 | protect the nym database. Your passphrase should be long, and hard to guess. 154 | Anyone who gets hold of your nym database and private keys and can determine 155 | the passphrase will be able to compromise your pseudonymous identities. Note 156 | that some operating systems may store your passphrase on your hard disk in 157 | clear. 158 | 159 | While a good client passphrase can protect your keys if someone gets hold of 160 | your files, the remailer passphrase offers only casual protection for the 161 | remailer keys. If you install a remailer, the remailer passphrase must be 162 | different from your private passphrases. 163 | 164 | Note that nym.alias.net style nym-servers are trivially breakable by an 165 | adversary performing a long-term intersection attack. Discussion of 166 | these attacks can be found in section 4.2 of The Pynchon Gate, by 167 | Sassaman, Cohen, and Mathewson, 2005. Use of Type I remailers for any 168 | purpose is discouraged. 169 | 170 | 171 | Copyright: 172 | --------- 173 | 174 | Mixmaster may be redistributed and modified under certain conditions. This 175 | software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, 176 | either express or implied. See the file COPYRIGHT for details. 177 | 178 | A license is required to use the IDEA(TM) algorithm for commercial purposes; 179 | see the file idea.txt for details. 180 | 181 | Mixmaster uses the compression library zlib by Jean-loup Gailly and Mark Adler, 182 | the free ncurses library and the regex library by Philip Hazel. This product 183 | includes cryptographic software written by Eric Young (eay@cryptsoft.com). This 184 | product includes software developed by the OpenSSL Project for use in the 185 | OpenSSL Toolkit (http://www.OpenSSL.org/). For some platforms: This product 186 | includes software developed by the University of California, Berkeley and its 187 | contributors. 188 | 189 | Additionally, this software uses code provided by the members of the 190 | Mixmaster development team. The members respectively hold the copyright 191 | to the code in question, having elected to make it available under the 192 | Mixmaster license. 193 | 194 | All trademarks are the property of their respective owners. 195 | 196 | $Id$ 197 | -------------------------------------------------------------------------------- /Src/maildir.c: -------------------------------------------------------------------------------- 1 | /* Mixmaster version 3.1 -- (C) 1999 - 2016 Anonymizer Inc. and others. 2 | 3 | Mixmaster may be redistributed and modified under certain conditions. 4 | This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 5 | ANY KIND, either express or implied. See the file COPYRIGHT for 6 | details. 7 | 8 | Maildir support routines 9 | $Id: $ */ 10 | 11 | 12 | /* Maildir support for Mixmaster 3 - see 13 | http://www.qmail.org/man/man5/maildir.html and 14 | http://cr.yp.to/proto/maildir.html 15 | 16 | Added by and (C) 2001 Doobee R. Tzeck 17 | drt@un.bewaff.net - http://c0re.jp/ 18 | 19 | To test it try: 20 | $ gcc maildir.c -DUNITTEST -o test_maildir 21 | $ ./test_maildir 22 | this should print a single line saying "OK" 23 | */ 24 | 25 | #include "mix3.h" 26 | 27 | #ifdef WIN32 28 | #include 29 | #include 30 | #include 31 | #define S_IWUSR _S_IWRITE 32 | #define S_IRUSR _S_IREAD 33 | #else /* end of WIN32 */ 34 | #include 35 | #endif /* else not WIN32 */ 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | 45 | #if defined(S_IFDIR) && !defined(S_ISDIR) 46 | #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) 47 | #endif /* defined(S_IFDIR) && !defined(S_ISDIR) */ 48 | 49 | #ifndef SHORTNAMES 50 | 51 | static unsigned long namecounter = 0; 52 | 53 | int checkDirectory(char *dir, char *append, int create) { 54 | char tmp[PATHMAX]; 55 | struct stat buf; 56 | int err; 57 | 58 | tmp[0] = '\0'; 59 | strcatn(tmp, dir, PATHMAX); 60 | if (append) 61 | strcatn(tmp, append, PATHMAX); 62 | 63 | err = stat(tmp, &buf); 64 | if (err == -1) { 65 | if (create) { 66 | #ifndef POSIX 67 | err = mkdir(tmp); 68 | #else /* end of not POSIX */ 69 | err = mkdir(tmp, S_IRWXU); 70 | #endif /* else if POSIX */ 71 | if (err == 0) 72 | errlog(NOTICE, "Creating directory %s.\n", tmp); 73 | } else 74 | err = 1; 75 | } else if (!S_ISDIR(buf.st_mode)) 76 | err = -1; 77 | 78 | return err; 79 | } 80 | 81 | /* Write "message" to "maildir", retunr 0 on success, -1 on failure */ 82 | #define MAX_BASENAME 113 /* actual length should be smaller than 111 bytes */ 83 | #define MAX_SUBNAME 123 /* actual length should be smaller than 115 bytes */ 84 | int maildirWrite(char *maildir, BUFFER *message, int create) { 85 | int fd; 86 | int count; 87 | int returnValue; 88 | char hostname[64]; 89 | struct stat statbuf; 90 | char basename[MAX_BASENAME]; 91 | char tmpname[MAX_SUBNAME]; 92 | char newname[MAX_SUBNAME]; 93 | int messagesize; 94 | char olddirectory[PATHMAX] = ""; 95 | char normalizedmaildir[PATHMAX]; 96 | 97 | /* Declare a handler for SIGALRM so we can time out. */ 98 | /* set_handler(SIGALRM, alarm_handler); */ 99 | /* alarm(86400); */ 100 | 101 | hostname[0] = '\0'; 102 | gethostname(hostname, 63); 103 | hostname[63] = '\0'; 104 | 105 | mixfile(normalizedmaildir, maildir); 106 | if ((checkDirectory(normalizedmaildir, NULL, create) != 0) || 107 | (checkDirectory(normalizedmaildir, "tmp", create) != 0) || 108 | (checkDirectory(normalizedmaildir, "cur", create) != 0) || 109 | (checkDirectory(normalizedmaildir, "new", create) != 0)) { 110 | returnValue = -1; 111 | goto realend; 112 | } 113 | 114 | messagesize = message->length; 115 | 116 | /* Step 1: chdir to maildir (and save current dir) */ 117 | if (getcwd(olddirectory, PATHMAX) == NULL) { 118 | returnValue = -1; 119 | goto realend; 120 | } 121 | olddirectory[PATHMAX-1] = '\0'; 122 | if(chdir(normalizedmaildir) != 0) { 123 | returnValue = -1; 124 | goto functionExit; 125 | } 126 | 127 | /* Step 2: Stat the temporary file. Wait for ENOENT as a response. */ 128 | for (count = 0;; count++) { 129 | tmpname[0] = '\0'; 130 | newname[0] = '\0'; 131 | snprintf(basename, MAX_BASENAME, "%lu.%u_%lu.%s,S=%u", 132 | time(NULL), getpid(), namecounter++, hostname, messagesize); 133 | basename[MAX_BASENAME-1] = '\0'; 134 | strcatn(tmpname, "tmp" DIRSEPSTR, MAX_SUBNAME); 135 | strcatn(tmpname, basename, MAX_SUBNAME); 136 | strcatn(newname, "new" DIRSEPSTR, MAX_SUBNAME); 137 | strcatn(newname, basename, MAX_SUBNAME); 138 | 139 | if (stat(tmpname, &statbuf) == 0) 140 | errno = EEXIST; 141 | else if (errno == ENOENT) { 142 | /* Step 4: create the file (at least try) */ 143 | fd = open(tmpname, O_WRONLY|O_CREAT|O_EXCL, S_IWUSR|S_IRUSR); 144 | if (fd >= 0) 145 | break; /* we managed to open the file */ 146 | } 147 | 148 | if (count > 5) { 149 | /* Too many retries - give up */ 150 | errlog(ERRORMSG, "Can't create message in %s\n", maildir); 151 | returnValue = -1; 152 | goto functionExit; 153 | } 154 | 155 | /* Step 3: sleep and retry */ 156 | sleep(2); 157 | } 158 | 159 | /* Step 5: write file */ 160 | if(write(fd, message->data, message->length) != message->length) { 161 | returnValue = -1; 162 | goto functionExit; 163 | } 164 | 165 | /* on NFS this could fail */ 166 | #ifndef WIN32 167 | if((fsync(fd) != 0) || (close(fd) != 0)) { 168 | #else /* end of not WIN32 */ 169 | if((_commit(fd) != 0) || (close(fd) != 0)) { 170 | #endif /* else if WIN32 */ 171 | returnValue = -1; 172 | goto functionExit; 173 | } 174 | 175 | /* Step 6: move message to 'cur' */ 176 | #ifdef POSIX 177 | for (count = 0;; count++) { 178 | if(link(tmpname, newname) != 0) { 179 | if (errno == EXDEV || errno == EPERM) { 180 | /* We probably are on coda or some other filesystem that does not allow 181 | * hardlinks. rename() the file instead of link() and unlink() 182 | * I know, It's evil (PP). 183 | */ 184 | if (rename(tmpname, newname) != 0) { 185 | returnValue = -1; 186 | goto functionExit; 187 | }; 188 | break; 189 | } else if (errno != EEXIST) { 190 | returnValue = -1; 191 | goto functionExit; 192 | } 193 | } else { 194 | /* We successfully linked the message in new/. Now let's get 195 | * rid of our tmp/ entry 196 | */ 197 | if(unlink(tmpname) != 0) { 198 | /* unlinking failed */ 199 | returnValue = -1; 200 | goto functionExit; 201 | } 202 | break; 203 | } 204 | 205 | if (count > 5) { 206 | /* Too many retries - give up */ 207 | errlog(ERRORMSG, "Can't move message to %s/new/\n", maildir); 208 | returnValue = -1; 209 | goto functionExit; 210 | } 211 | 212 | sleep(2); 213 | newname[0] = '\0'; 214 | snprintf(basename, MAX_BASENAME, "%lu.%u_%lu.%s,S=%u", 215 | time(NULL), getpid(), namecounter++, hostname, messagesize); 216 | basename[MAX_BASENAME-1] = '\0'; 217 | strcatn(newname, "new" DIRSEPSTR, MAX_SUBNAME); 218 | strcatn(newname, basename, MAX_SUBNAME); 219 | } 220 | #else /* end of POSIX */ 221 | /* On non POSIX systems we simply use rename(). Let's hope DJB 222 | * never finds out 223 | */ 224 | if (rename(tmpname, newname) != 0) { 225 | returnValue = -1; 226 | goto functionExit; 227 | }; 228 | #endif /* else if not POSIX */ 229 | 230 | returnValue = 0; 231 | 232 | functionExit: 233 | /* return to original directory */ 234 | assert(olddirectory[0] != '\0'); 235 | if(chdir(olddirectory) != 0) 236 | returnValue = -1; 237 | 238 | realend: 239 | 240 | return returnValue; 241 | } 242 | 243 | #else /* end of SHORTNAMES */ 244 | int maildirWrite(char *maildir, BUFFER *message, int create) { 245 | { 246 | errlog(ERRORMSG, "Maildir delivery does not work with SHORTNAMES.\n"); 247 | return -1; 248 | } 249 | #endif /* else if not SHORTNAMES */ 250 | 251 | 252 | #ifdef UNITTEST 253 | 254 | #include 255 | 256 | /* mock-up of errlog for unittest */ 257 | void errlog(int type, char *fmt,...) 258 | { 259 | va_list ap; 260 | 261 | va_start(ap, fmt); 262 | vfprintf(stderr, fmt, ap); 263 | va_end(ap); 264 | } 265 | 266 | /* main for unittest */ 267 | int main() 268 | { 269 | int i, j, maildirWriteRes, count = 23; 270 | int fd; 271 | DIR *d; 272 | struct dirent *de; 273 | BUFFER message; 274 | char text[] = "From: nobody@un.bewaff.net\nTo: hackers@c0re.jp\nSubject: testing\n\nthis is just a test\n"; 275 | char buf[1024]; 276 | 277 | /* create buffer with test data */ 278 | message.data = text; 279 | message.length = strlen(text); 280 | 281 | /* write messages to maildir */ 282 | for(i = 0; i < count; i++) { 283 | maildirWriteRes = maildirWrite("Maildir.test_maildir", message, 1); 284 | assert(maildirWriteRes == 0); 285 | } 286 | 287 | /* read them back */ 288 | d = opendir("Maildir.test_maildir/new"); 289 | assert(d != NULL); 290 | for (i = 0; i < count + 2; i++) 291 | { 292 | de = readdir(d); 293 | if(de->d_name[0] != '.') 294 | { 295 | buf[0] = '\0'; 296 | strcat(buf, "Maildir.test_maildir/new/"); 297 | strcat(buf, de->d_name); 298 | fd = open(buf, O_RDONLY); 299 | j = unlink(buf); 300 | assert(j == 0); 301 | j = read(fd, buf, strlen(text)); 302 | assert(j == strlen(text)); 303 | buf[strlen(text)] = '\0'; 304 | /* check if they match the original message */ 305 | assert(strcmp(text, buf) == 0); 306 | close(fd); 307 | } 308 | } 309 | 310 | /* no files left in directory? */ 311 | assert(readdir(d) == NULL); 312 | 313 | /* delete maildir */ 314 | j = rmdir("Maildir.test_maildir/tmp"); 315 | assert(j == 0); 316 | j = rmdir("Maildir.test_maildir/new"); 317 | assert(j == 0); 318 | j = rmdir("Maildir.test_maildir/cur"); 319 | assert(j == 0); 320 | j = rmdir("Maildir.test_maildir"); 321 | assert(j == 0); 322 | 323 | /* check if writing to a non existant maildir yields an error */ 324 | assert(maildirWrite("Maildir.test_maildir", &message, 0) == -1); 325 | 326 | puts("OK"); 327 | } 328 | #endif /* UNITTEST */ 329 | -------------------------------------------------------------------------------- /Src/chain1.c: -------------------------------------------------------------------------------- 1 | /* Mixmaster version 3.1 -- (C) 1999 - 2016 Anonymizer Inc. and others. 2 | 3 | Mixmaster may be redistributed and modified under certain conditions. 4 | This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 5 | ANY KIND, either express or implied. See the file COPYRIGHT for 6 | details. 7 | 8 | Encrypt message for Cypherpunk remailer chain 9 | $Id$ */ 10 | 11 | 12 | #include "mix3.h" 13 | #include "pgp.h" 14 | #include 15 | #include 16 | 17 | #define N(X) (isdigit(X) ? (X)-'0' : 0) 18 | 19 | int t1_rlist(REMAILER remailer[], int badchains[MAXREM][MAXREM]) 20 | { 21 | FILE *list, *excl; 22 | int i, listed = 0; 23 | int n = 0; 24 | char line[2 * LINELEN], l2[LINELEN], name[LINELEN], *flags; 25 | BUFFER *starex; 26 | 27 | starex = buf_new(); 28 | excl = mix_openfile(STAREX, "r"); 29 | if (excl != NULL) { 30 | buf_read(starex, excl); 31 | fclose(excl); 32 | } 33 | 34 | list = mix_openfile(TYPE1LIST, "r"); 35 | if (list == NULL) { 36 | buf_free(starex); 37 | return (-1); 38 | } 39 | 40 | while (fgets(line, sizeof(line), list) != NULL && n < MAXREM) { 41 | if (strleft(line, "$remailer") && 42 | strchr(line, '<') && strchr(line, '>') && 43 | strchr(line, '{') && strchr(line, '{') + 4 < strchr(line, '}')) { 44 | if (line[strlen(line) - 1] == '\n') 45 | line[strlen(line) - 1] = '\0'; 46 | if (line[strlen(line) - 1] == '\r') 47 | line[strlen(line) - 1] = '\0'; 48 | while (line[strlen(line) - 1] == ' ') 49 | line[strlen(line) - 1] = '\0'; 50 | if (line[strlen(line) - 1] != ';' 51 | && fgets(l2, sizeof(l2), list) != NULL) 52 | strcatn(line, l2, LINELEN); 53 | flags = strchr(line, '>'); 54 | strncpy(name, strchr(line, '{') + 2, 55 | strchr(line, '}') - strchr(line, '{') - 3); 56 | name[strchr(line, '}') - strchr(line, '{') - 3] = '\0'; 57 | name[20] = '\0'; 58 | 59 | for (i = 1; i <= n; i++) 60 | if (streq(name, remailer[i].name)) 61 | break; 62 | if (i > n) { 63 | /* not in mix list */ 64 | n++; 65 | strcpy(remailer[i].name, name); 66 | strncpy(remailer[i].addr, strchr(line, '<') + 1, 67 | strchr(line, '>') - strchr(line, '<')); 68 | remailer[i].addr[strchr(line, '>') - strchr(line, '<') - 1] 69 | = '\0'; 70 | remailer[i].flags.mix = 0; 71 | remailer[i].flags.post = strifind(flags, " post"); 72 | } 73 | remailer[i].flags.cpunk = strfind(flags, " cpunk"); 74 | remailer[i].flags.pgp = strfind(flags, " pgp"); 75 | remailer[i].flags.pgponly = strfind(flags, " pgponly"); 76 | remailer[i].flags.latent = strfind(flags, " latent"); 77 | remailer[i].flags.middle = strfind(flags, " middle"); 78 | remailer[i].flags.ek = strfind(flags, " ek"); 79 | remailer[i].flags.esub = strfind(flags, " esub"); 80 | remailer[i].flags.hsub = strfind(flags, " hsub"); 81 | remailer[i].flags.newnym = strfind(flags, " newnym"); 82 | remailer[i].flags.nym = strfind(flags, " nym"); 83 | remailer[i].info[1].reliability = 0; 84 | remailer[i].info[1].latency = 0; 85 | remailer[i].info[1].history[0] = '\0'; 86 | remailer[i].flags.star_ex = bufifind(starex, name); 87 | } 88 | if (strleft(line, 89 | "-----------------------------------------------------------------------")) 90 | break; 91 | } 92 | n++; /* ?? */ 93 | while (fgets(line, sizeof(line), list) != NULL) { 94 | if (strlen(line) >= 72 && strlen(line) <= 73) 95 | for (i = 1; i < n; i++) 96 | if (strleft(line, remailer[i].name) && 97 | line[strlen(remailer[i].name)] == ' ') { 98 | strncpy(remailer[i].info[1].history, line + 42, 12); 99 | remailer[i].info[1].history[12] = '\0'; 100 | remailer[i].info[1].reliability = 10000 * N(line[64]) 101 | + 1000 * N(line[65]) + 100 * N(line[66]) 102 | + 10 * N(line[68]) + N(line[69]); 103 | remailer[i].info[1].latency = 36000 * N(line[55]) 104 | + 3600 * N(line[56]) + 600 * N(line[58]) 105 | + 60 * N(line[59]) + 10 * N(line[61]) 106 | + N(line[62]); 107 | listed++; 108 | } 109 | } 110 | fclose(list); 111 | parse_badchains(badchains, TYPE1LIST, "Broken type-I remailer chains", remailer, n); 112 | if (listed < 4) /* we have no valid reliability info */ 113 | for (i = 1; i < n; i++) 114 | remailer[i].info[1].reliability = 10000; 115 | 116 | #ifdef USE_PGP 117 | pgp_rlist(remailer, n); 118 | #endif /* USE_PGP */ 119 | buf_free(starex); 120 | return (n); 121 | } 122 | 123 | int t1_ek(BUFFER *key, BUFFER *seed, int num) 124 | { 125 | buf_reset(key); 126 | buf_appendc(key, (byte) num); 127 | buf_cat(key, seed); 128 | digest_md5(key, key); 129 | encode(key, 0); 130 | #ifdef DEBUG 131 | fprintf(stderr, "passphrase=%s (%2X%2X%2X%2X %d)\n", key->data, 132 | seed->data[0], seed->data[1], seed->data[2], seed->data[3], num); 133 | #endif /* DEBUG */ 134 | return (0); 135 | } 136 | 137 | int t1_encrypt(int type, BUFFER *message, char *chainstr, int latency, 138 | BUFFER *ek, BUFFER *feedback) 139 | { 140 | BUFFER *b, *rem, *dest, *line, *field, *content; 141 | REMAILER remailer[MAXREM]; 142 | int badchains[MAXREM][MAXREM]; 143 | int maxrem, chainlen = 0; 144 | int chain[20]; 145 | int hop; 146 | int hashmark = 0; 147 | int err = 0; 148 | 149 | b = buf_new(); 150 | rem = buf_new(); 151 | dest = buf_new(); 152 | line = buf_new(); 153 | field = buf_new(); 154 | content = buf_new(); 155 | 156 | maxrem = t1_rlist(remailer, badchains); 157 | if (maxrem < 1) { 158 | clienterr(feedback, "No remailer list!"); 159 | err = -1; 160 | goto end; 161 | } 162 | chainlen = chain_select(chain, chainstr, maxrem, remailer, 1, line); 163 | if (chainlen < 1) { 164 | if (line->length) 165 | clienterr(feedback, line->data); 166 | else 167 | clienterr(feedback, "Invalid remailer chain!"); 168 | err = -1; 169 | goto end; 170 | } 171 | if (chain[0] == 0) 172 | chain[0] = chain_randfinal(type, remailer, badchains, maxrem, 1, chain, chainlen, 0); 173 | 174 | if (chain[0] == -1) { 175 | clienterr(feedback, "Invalid remailer chain!"); 176 | err = -1; 177 | goto end; 178 | } 179 | if (chain_rand(remailer, badchains, maxrem, chain, chainlen, 1, 0) == -1) { 180 | clienterr(feedback, "No reliable remailers!"); 181 | err = -1; 182 | goto end; 183 | } 184 | while (buf_getheader(message, field, content) == 0) { 185 | hdr_encode(content, 0); 186 | if (type == MSG_POST && bufieq(field, "newsgroups") && 187 | remailer[chain[0]].flags.post) { 188 | buf_appendf(dest, "Anon-Post-To: %b\n", content); 189 | } else if (type == MSG_MAIL && bufieq(field, "to")) { 190 | buf_appendf(dest, "Anon-To: %b\n", content); 191 | } else { 192 | /* paste header */ 193 | if (type == MSG_POST && bufieq(field, "newsgroups")) 194 | buf_appendf(dest, "Anon-To: %s\n", MAILtoNEWS); 195 | if (hashmark == 0) { 196 | buf_appends(b, "##\n"); 197 | hashmark = 1; 198 | } 199 | buf_appendheader(b, field, content); 200 | } 201 | } 202 | buf_nl(b); 203 | buf_rest(b, message); 204 | buf_move(message, b); 205 | 206 | if (type != MSG_NULL && dest->length == 0) { 207 | clienterr(feedback, "No destination address!"); 208 | err = -1; 209 | goto end; 210 | } 211 | if (type == MSG_NULL) { 212 | buf_sets(dest, "Null:\n"); 213 | } 214 | for (hop = 0; hop < chainlen; hop++) { 215 | if (hop == 0) { 216 | buf_sets(b, "::\n"); 217 | buf_cat(b, dest); 218 | } else { 219 | buf_sets(b, "::\nAnon-To: "); 220 | buf_appends(b, remailer[chain[hop - 1]].addr); 221 | buf_nl(b); 222 | } 223 | if (remailer[chain[hop]].flags.latent && latency > 0) 224 | buf_appendf(b, "Latent-Time: +%d:00r\n", latency); 225 | if (ek && remailer[chain[hop]].flags.ek) { 226 | t1_ek(line, ek, hop); 227 | buf_appendf(b, "Encrypt-Key: %b\n", line); 228 | } 229 | buf_nl(b); 230 | buf_cat(b, message); 231 | #ifdef USE_PGP 232 | if (remailer[chain[hop]].flags.pgp) { 233 | buf_clear(message); 234 | buf_clear(rem); 235 | buf_setf(rem, "<%s>", remailer[chain[hop]].addr); 236 | err = pgp_encrypt(PGP_ENCRYPT | PGP_REMAIL | PGP_TEXT, b, rem, 237 | NULL, NULL, NULL, NULL); 238 | if (err < 0) { 239 | buf_setf(line, "No PGP key for remailer %s!\n", 240 | remailer[chain[hop]].name); 241 | clienterr(feedback, line->data); 242 | goto end; 243 | } 244 | buf_appends(message, "::\nEncrypted: PGP\n\n"); 245 | buf_cat(message, b); 246 | } else 247 | #endif /* USE_PGP */ 248 | { 249 | if (remailer[chain[hop]].flags.pgponly) { 250 | buf_setf(line, "PGP encryption needed for remailer %s!\n", 251 | remailer[chain[hop]].name); 252 | clienterr(feedback, line->data); 253 | goto end; 254 | } 255 | buf_move(message, b); 256 | } 257 | if (ek && remailer[chain[hop]].flags.ek) 258 | buf_appends(message, "\n**\n"); 259 | } 260 | buf_clear(b); 261 | if (chainlen == 0) { 262 | buf_appends(b, "::\n"); 263 | buf_cat(b, dest); 264 | } else { 265 | buf_appendf(b, "%s: %s\n", ek ? "::\nAnon-To" : "To", 266 | remailer[chain[chainlen - 1]].addr); 267 | } 268 | buf_nl(b); 269 | buf_cat(b, message); 270 | buf_move(message, b); 271 | end: 272 | buf_free(b); 273 | buf_free(rem); 274 | buf_free(dest); 275 | buf_free(line); 276 | buf_free(field); 277 | buf_free(content); 278 | return (err); 279 | } 280 | 281 | #ifdef USE_PGP 282 | int t1_getreply(BUFFER *msg, BUFFER *ek, int len) 283 | { 284 | BUFFER *key, *decrypt; 285 | int err = -1; 286 | int hop = 0; 287 | 288 | key = buf_new(); 289 | decrypt = buf_new(); 290 | 291 | do { 292 | t1_ek(key, ek, hop); 293 | buf_set(decrypt, msg); 294 | if (pgp_decrypt(decrypt, key, NULL, NULL, NULL) == 0 295 | && decrypt->data != NULL) 296 | err = 0, buf_move(msg, decrypt); 297 | } 298 | while (hop++ < len); 299 | return (err); 300 | } 301 | 302 | #endif /* USE_PGP */ 303 | -------------------------------------------------------------------------------- /Src/service.c: -------------------------------------------------------------------------------- 1 | /* Mixmaster version 3.1 -- (C) 1999 - 2016 Anonymizer Inc. and others. 2 | 3 | Mixmaster may be redistributed and modified under certain conditions. 4 | This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 5 | ANY KIND, either express or implied. See the file COPYRIGHT for 6 | details. 7 | 8 | Win32 Service support 9 | $Id$ */ 10 | 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #include "mix3.h" 19 | 20 | #ifdef WIN32SERVICE 21 | 22 | #define SVCNAME "Mixmaster" 23 | #define SVCDISPLAYNAME "Mixmaster Service" 24 | 25 | 26 | /* internal variables */ 27 | static SERVICE_STATUS ssStatus; 28 | static SERVICE_STATUS_HANDLE sshStatusHandle; 29 | static BOOL not_service = FALSE; 30 | 31 | static HANDLE hThread = NULL; 32 | static HANDLE hMustTerminate = NULL; 33 | 34 | /* internal function prototypes */ 35 | VOID WINAPI service_ctrl(DWORD ctrl_code); 36 | VOID WINAPI service_main(DWORD argc, LPSTR *argv); 37 | static DWORD service_run(void); 38 | static void service_stop(); 39 | static int set_stdfiles(); 40 | static int install_service(); 41 | static int remove_service(); 42 | static int run_notservice(int argc, char **argv); 43 | BOOL WINAPI console_ctrl_handler(DWORD ctrl_type); 44 | static char *GetLastErrorText(); 45 | static BOOL send_status(DWORD current_state, DWORD exit_code, DWORD wait_hint, DWORD id); 46 | static void event_log(DWORD id, char *eventmsg); 47 | 48 | int mix_main(int argc, char *argv[]); 49 | 50 | 51 | int main(int argc, char *argv[]) 52 | { 53 | SERVICE_TABLE_ENTRY dispatchTable[] = { 54 | {SVCNAME, (LPSERVICE_MAIN_FUNCTION)service_main}, 55 | {NULL, NULL} }; 56 | 57 | if ((argc > 1) && ((argv[1][0] == '-') && (argv[1][1] == '-'))) { 58 | if (!_stricmp("install-svc", argv[1]+2)) 59 | return install_service(); 60 | else if (!_stricmp("remove-svc", argv[1]+2)) 61 | return remove_service(); 62 | else if (_stricmp("run-svc", argv[1]+2) && !is_nt_service()) 63 | return run_notservice(argc, argv); 64 | } else if (!is_nt_service()) { 65 | return run_notservice(argc, argv); 66 | } 67 | printf("mix --install-svc install the service\n"); 68 | printf("mix --remove-svc remove the service\n"); 69 | printf("mix --run-svc run as a service\n"); 70 | printf("mix -h view a summary of the command line options.\n"); 71 | 72 | printf("\nStartServiceCtrlDispatcher being called.\n" ); 73 | printf("This may take several seconds. Please wait.\n" ); 74 | if (!StartServiceCtrlDispatcher(dispatchTable)) { 75 | printf("Service not started: StartServiceCtrlDispatcher failed.\n" ); 76 | event_log(1000, "Service not started: StartServiceCtrlDispatcher failed"); 77 | } 78 | return 0; 79 | } /* main */ 80 | 81 | 82 | VOID WINAPI service_main(DWORD argc, LPSTR *argv) 83 | { 84 | DWORD err = 0; 85 | 86 | if (!(sshStatusHandle = RegisterServiceCtrlHandler(SVCNAME, service_ctrl))) 87 | return; 88 | 89 | ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; 90 | ssStatus.dwServiceSpecificExitCode = 0; 91 | if (send_status(SERVICE_START_PENDING, NO_ERROR, 1000, 1020)) 92 | err = service_run(); 93 | 94 | send_status(SERVICE_STOPPED, err, 0, err ? 1030 : 30); 95 | } /* service_main */ 96 | 97 | 98 | VOID WINAPI service_ctrl(DWORD ctrl_code) 99 | { /* Handle the requested control code. */ 100 | if (ctrl_code == SERVICE_CONTROL_STOP || ctrl_code == SERVICE_CONTROL_SHUTDOWN) 101 | service_stop(); 102 | else 103 | send_status(ssStatus.dwCurrentState, NO_ERROR, 0, 1040 + ctrl_code); 104 | } /* service_ctrl */ 105 | 106 | 107 | static DWORD service_run(void) 108 | { 109 | char filename[_MAX_PATH+1]; 110 | char home[_MAX_PATH+1], *p; 111 | char *svc_argv[2] = {filename, "-D"}; 112 | 113 | if (!hMustTerminate) 114 | hMustTerminate = CreateEvent(NULL, FALSE, FALSE, NULL); 115 | set_nt_exit_event(hMustTerminate); 116 | DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), 117 | &hThread, 0, FALSE, DUPLICATE_SAME_ACCESS); 118 | 119 | GetModuleFileName(NULL , filename, _MAX_PATH); 120 | strcpy(home, filename); 121 | if (p = strrchr(home, '\\')) { 122 | *p = 0; 123 | chdir(home); 124 | } 125 | 126 | if (!set_stdfiles()) { 127 | event_log(1010, "stdin|stdout|stderr not created"); 128 | return ERROR_SERVICE_NOT_ACTIVE; 129 | } 130 | 131 | send_status(SERVICE_RUNNING, NO_ERROR, 0, 1060); 132 | event_log(10, "Mixmaster Service started"); 133 | 134 | mix_main(2, svc_argv); 135 | return 0; 136 | } /* service_run */ 137 | 138 | 139 | static void service_stop(void) 140 | { 141 | send_status(SERVICE_STOP_PENDING, NO_ERROR, 5000, 1070); 142 | if (hMustTerminate) { 143 | SetEvent(hMustTerminate); 144 | if (WaitForSingleObject(hThread, 4500) == WAIT_TIMEOUT) { 145 | if (hThread) { 146 | TerminateThread(hThread, 0); 147 | event_log(1080, "Mixmaster Service terminated forcibly"); 148 | } 149 | } else 150 | event_log(20, "Mixmaster Service stopped"); 151 | CloseHandle(hMustTerminate); 152 | hMustTerminate = NULL; 153 | } else 154 | if (hThread) 155 | TerminateThread(hThread, 0); 156 | if (hThread) 157 | CloseHandle(hThread); 158 | hThread = NULL; 159 | ssStatus.dwCurrentState = SERVICE_STOPPED; 160 | } /* service_stop */ 161 | 162 | 163 | static int set_stdfiles() 164 | { /* needed for _popen() */ 165 | static DWORD std_handles[]={STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, STD_ERROR_HANDLE}; 166 | FILE *stdfile[]={stdin, stdout, stderr}; 167 | HANDLE hStd; 168 | int fh, stf_fileno; 169 | FILE *fl; 170 | 171 | AllocConsole(); 172 | for (stf_fileno=0; stf_fileno<=2; stf_fileno++) { 173 | hStd = GetStdHandle(std_handles[stf_fileno]); 174 | if (hStd == INVALID_HANDLE_VALUE) 175 | return 0; 176 | fh = _open_osfhandle((long)std_handles[stf_fileno], (stf_fileno ? _O_WRONLY : _O_RDONLY ) | _O_BINARY); 177 | dup2(fh, stf_fileno); 178 | fl = _fdopen(stf_fileno, (stf_fileno ? "wcb" : "rcb" )); 179 | fflush(stdfile[stf_fileno]); 180 | memcpy(stdfile[stf_fileno], fl, sizeof(FILE)); 181 | } 182 | return 1; 183 | } /* set_stdfiles */ 184 | 185 | 186 | static BOOL send_status(DWORD current_state, DWORD exit_code, DWORD wait_hint, DWORD id) 187 | { 188 | static DWORD dwCheckPoint = 1; 189 | BOOL ret_val; 190 | 191 | if (not_service) 192 | return TRUE; 193 | 194 | ssStatus.dwCurrentState = current_state; 195 | ssStatus.dwWin32ExitCode = exit_code; 196 | ssStatus.dwWaitHint = wait_hint; 197 | ssStatus.dwControlsAccepted = (current_state == SERVICE_START_PENDING) ? 198 | 0 : SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; 199 | ssStatus.dwCheckPoint = ((current_state == SERVICE_RUNNING) || (current_state == SERVICE_STOPPED)) ? 200 | 0 : dwCheckPoint++; 201 | 202 | if (!(ret_val = SetServiceStatus(sshStatusHandle, &ssStatus))) 203 | event_log(id, "SetServiceStatus failed"); 204 | return ret_val; 205 | } /* send_status */ 206 | 207 | 208 | static void event_log(DWORD id, char *eventmsg) 209 | { 210 | HANDLE hEventSource; 211 | char *pStrings[2] = {"", eventmsg}; 212 | 213 | if (not_service) 214 | return; 215 | 216 | if (id > 1000) 217 | pStrings[0] = GetLastErrorText(); 218 | 219 | if (!(hEventSource = RegisterEventSource(NULL, SVCNAME))) 220 | return; 221 | ReportEvent(hEventSource, (WORD)((id < 1000) ? EVENTLOG_SUCCESS : EVENTLOG_ERROR_TYPE), 222 | 0, id, NULL, 2, 0, pStrings, NULL); 223 | DeregisterEventSource(hEventSource); 224 | } /* event_log */ 225 | 226 | 227 | static int run_notservice(int argc, char ** argv) 228 | { 229 | not_service = TRUE; 230 | return mix_main(argc, argv); 231 | } /* run_notservice */ 232 | 233 | 234 | static int install_service() 235 | { 236 | SC_HANDLE schService, schSCManager; 237 | char filename[_MAX_PATH+10]; 238 | 239 | if (GetModuleFileName(NULL, filename, _MAX_PATH) == 0) { 240 | printf("Unable to install Mixmaster Service: %s\n", GetLastErrorText()); 241 | return 1; 242 | } 243 | strcat(filename, " --run-svc"); 244 | 245 | if (!(schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS))) { 246 | printf("OpenSCManager failed: %s\n", GetLastErrorText()); 247 | return 1; 248 | } 249 | schService = CreateService(schSCManager, SVCNAME, SVCDISPLAYNAME, 250 | SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, 251 | filename, NULL, NULL, NULL, NULL, NULL); 252 | 253 | if (schService) { 254 | printf("Mixmaster Service installed.\n"); 255 | CloseServiceHandle(schService); 256 | } else { 257 | printf("CreateService failed: %s\n", GetLastErrorText()); 258 | } 259 | 260 | CloseServiceHandle(schSCManager); 261 | return 0; 262 | } /* install_service */ 263 | 264 | 265 | static int remove_service() 266 | { 267 | SC_HANDLE schService, schSCManager; 268 | int ret_val = 0; 269 | 270 | if (!(schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS))) { 271 | printf("OpenSCManager failed: %s\n", GetLastErrorText()); 272 | return 1; 273 | } 274 | if (!(schService = OpenService(schSCManager, SVCNAME, SERVICE_ALL_ACCESS))) { 275 | CloseServiceHandle(schSCManager); 276 | printf("OpenService failed: %s\n", GetLastErrorText()); 277 | return 1; 278 | } 279 | /* try to stop the service */ 280 | if (ControlService(schService, SERVICE_CONTROL_STOP, &ssStatus)) { 281 | printf("Stopping Mixmaster Service"); 282 | do { 283 | sleep(1); 284 | printf("."); 285 | QueryServiceStatus(schService, &ssStatus); 286 | } while (ssStatus.dwCurrentState != SERVICE_STOP_PENDING); 287 | 288 | if (ssStatus.dwCurrentState == SERVICE_STOPPED) 289 | printf("\nMixmaster Service stopped.\n"); 290 | else 291 | printf("\n%Mixmaster Service failed to stop.\n"); 292 | } 293 | 294 | /* now remove the service */ 295 | if (!DeleteService(schService)) { 296 | ret_val = 1; 297 | printf("DeleteService failed: %s\n", GetLastErrorText()); 298 | } else 299 | printf("Mixmaster Service removed.\n"); 300 | 301 | CloseServiceHandle(schService); 302 | CloseServiceHandle(schSCManager); 303 | return ret_val; 304 | } /* remove_service */ 305 | 306 | 307 | static char *GetLastErrorText() 308 | { 309 | static char error_buf[256]; 310 | DWORD dwRet, err; 311 | LPSTR lpszTemp = NULL; 312 | 313 | dwRet = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY, 314 | NULL, err=GetLastError(), LANG_NEUTRAL, (LPSTR)&lpszTemp, 0, NULL); 315 | 316 | /* supplied buffer is not long enough */ 317 | if (!dwRet || (256 < (long)dwRet+14)) 318 | sprintf(error_buf, "Error (0x%x)", err); 319 | else { 320 | lpszTemp[lstrlen(lpszTemp)-2] = '\0'; 321 | /* remove cr and newline character */ 322 | sprintf(error_buf, "%s (0x%x)", lpszTemp, err); 323 | } 324 | 325 | if (lpszTemp) 326 | LocalFree((HLOCAL)lpszTemp); 327 | 328 | return error_buf; 329 | } /* GetLastErrorText */ 330 | 331 | #endif /* WIN32SERVICE */ 332 | --------------------------------------------------------------------------------