markus@openbsd.org | 091c302 | 2015-01-19 19:52:16 +0000 | [diff] [blame] | 1 | /* $OpenBSD: deattack.h,v 1.11 2015/01/19 19:52:16 markus Exp $ */ |
Ben Lindstrom | 36579d3 | 2001-01-29 07:39:26 +0000 | [diff] [blame] | 2 | |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 3 | /* |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 4 | * Cryptographic attack detector for ssh - Header file |
| 5 | * |
| 6 | * Copyright (c) 1998 CORE SDI S.A., Buenos Aires, Argentina. |
| 7 | * |
| 8 | * All rights reserved. Redistribution and use in source and binary |
| 9 | * forms, with or without modification, are permitted provided that |
| 10 | * this copyright notice is retained. |
| 11 | * |
| 12 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED |
| 13 | * WARRANTIES ARE DISCLAIMED. IN NO EVENT SHALL CORE SDI S.A. BE |
| 14 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY OR |
| 15 | * CONSEQUENTIAL DAMAGES RESULTING FROM THE USE OR MISUSE OF THIS |
| 16 | * SOFTWARE. |
| 17 | * |
| 18 | * Ariel Futoransky <futo@core-sdi.com> |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 19 | * <http://www.core-sdi.com> |
| 20 | */ |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 21 | |
| 22 | #ifndef _DEATTACK_H |
| 23 | #define _DEATTACK_H |
| 24 | |
| 25 | /* Return codes */ |
| 26 | #define DEATTACK_OK 0 |
| 27 | #define DEATTACK_DETECTED 1 |
Damien Miller | 3c9c1fb | 2006-09-17 06:08:53 +1000 | [diff] [blame] | 28 | #define DEATTACK_DOS_DETECTED 2 |
markus@openbsd.org | 091c302 | 2015-01-19 19:52:16 +0000 | [diff] [blame] | 29 | #define DEATTACK_ERROR 3 |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 30 | |
markus@openbsd.org | 091c302 | 2015-01-19 19:52:16 +0000 | [diff] [blame] | 31 | struct deattack_ctx { |
| 32 | u_int16_t *h; |
| 33 | u_int32_t n; |
| 34 | }; |
| 35 | |
| 36 | void deattack_init(struct deattack_ctx *); |
| 37 | int detect_attack(struct deattack_ctx *, const u_char *, u_int32_t); |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 38 | #endif |