File: tap.h

package info (click to toggle)
proftpd-dfsg 1.3.4a-5%2Bdeb7u3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 27,820 kB
  • sloc: perl: 154,169; ansic: 128,582; sh: 13,564; php: 11,586; makefile: 2,156
file content (68 lines) | stat: -rw-r--r-- 2,721 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
 * ProFTPD - mod_sftp traffic analysis protection
 * Copyright (c) 2008-2011 TJ Saunders
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
 *
 * As a special exemption, TJ Saunders and other respective copyright holders
 * give permission to link this program with OpenSSL, and distribute the
 * resulting executable, without including the source code for OpenSSL in the
 * source distribution.
 *
 * $Id: tap.h,v 1.6 2011/05/23 20:40:13 castaglia Exp $
 */

#include "mod_sftp.h"

#ifndef MOD_SFTP_TAP_H
#define MOD_SFTP_TAP_H

int sftp_tap_have_policy(const char *);

/* May send an SSH2_MSG_IGNORE packet of random length, filled with random
 * data to the client, depending on the selected policy.  These messages can
 * be injected into the SSH session in order to make traffic analysis harder.
 * Returns -1 if there was an error while sending the packet, zero otherwise.
 */
int sftp_tap_send_packet(void);

/* Sets the traffic analysis protection (TAP) policy.  Returns 0 if the given
 * policy is acceptable, -1 otherwise.
 *
 * The list of policies is:
 *
 *  "none" - send no SSH2_MSG_IGNORE packets
 *
 *  "low" - 1 in 1000 chance of sending SSH2_MSG_IGNORE, with lengths of
 *          64 to 256 bytes of random data.
 *
 *  "medium" - 1 in 100 chance of sending SSH2_MSG_IGNORE, with lengths of
 *             32 to 768 bytes of random data.
 *
 *  "high" - 1 in 10 chance of sending SSH2_MSG_IGNORE, with lengths of
 *           16 to 2048 bytes of random data.
 *
 *  "paranoid" - always send SSH2_MSG_IGNORE packets, of lengths up to 8KB.
 *
 * Note that there is an additional TAP policy called 'rogaway'.  This
 * policy is automatically used if the negotiated server-to-client cipher
 * is any of the CBC ciphers.  The purpose of the 'rogaway' TAP policy is
 * to implement the mitigation of the Rogaway CBC mode attack (see RFC4251,
 * Section 9.3.1) via the use of IGNORE packets.  The use of the 'rogaway'
 * policy is hardcoded, and will override any configured TAP policy.
 */
int sftp_tap_set_policy(const char *);

#endif