summaryrefslogtreecommitdiff
path: root/cipher.h
diff options
context:
space:
mode:
Diffstat (limited to 'cipher.h')
-rw-r--r--cipher.h36
1 files changed, 23 insertions, 13 deletions
diff --git a/cipher.h b/cipher.h
index ae37b0bb8..79e8fb878 100644
--- a/cipher.h
+++ b/cipher.h
@@ -11,7 +11,7 @@
11 * 11 *
12 */ 12 */
13 13
14/* RCSID("$Id: cipher.h,v 1.4 1999/11/24 13:26:22 damien Exp $"); */ 14/* RCSID("$Id: cipher.h,v 1.5 1999/11/25 00:54:58 damien Exp $"); */
15 15
16#ifndef CIPHER_H 16#ifndef CIPHER_H
17#define CIPHER_H 17#define CIPHER_H
@@ -54,26 +54,34 @@ typedef struct {
54 } bf; 54 } bf;
55 } u; 55 } u;
56} CipherContext; 56} CipherContext;
57/* Returns a bit mask indicating which ciphers are supported by this 57/*
58 implementation. The bit mask has the corresponding bit set of each 58 * Returns a bit mask indicating which ciphers are supported by this
59 supported cipher. */ 59 * implementation. The bit mask has the corresponding bit set of each
60 * supported cipher.
61 */
60unsigned int cipher_mask(); 62unsigned int cipher_mask();
61 63
62/* Returns the name of the cipher. */ 64/* Returns the name of the cipher. */
63const char *cipher_name(int cipher); 65const char *cipher_name(int cipher);
64 66
65/* Parses the name of the cipher. Returns the number of the corresponding 67/*
66 cipher, or -1 on error. */ 68 * Parses the name of the cipher. Returns the number of the corresponding
69 * cipher, or -1 on error.
70 */
67int cipher_number(const char *name); 71int cipher_number(const char *name);
68 72
69/* Selects the cipher to use and sets the key. If for_encryption is true, 73/*
70 the key is setup for encryption; otherwise it is setup for decryption. */ 74 * Selects the cipher to use and sets the key. If for_encryption is true,
75 * the key is setup for encryption; otherwise it is setup for decryption.
76 */
71void 77void
72cipher_set_key(CipherContext * context, int cipher, 78cipher_set_key(CipherContext * context, int cipher,
73 const unsigned char *key, int keylen, int for_encryption); 79 const unsigned char *key, int keylen, int for_encryption);
74 80
75/* Sets key for the cipher by computing the MD5 checksum of the passphrase, 81/*
76 and using the resulting 16 bytes as the key. */ 82 * Sets key for the cipher by computing the MD5 checksum of the passphrase,
83 * and using the resulting 16 bytes as the key.
84 */
77void 85void
78cipher_set_key_string(CipherContext * context, int cipher, 86cipher_set_key_string(CipherContext * context, int cipher,
79 const char *passphrase, int for_encryption); 87 const char *passphrase, int for_encryption);
@@ -88,8 +96,10 @@ void
88cipher_decrypt(CipherContext * context, unsigned char *dest, 96cipher_decrypt(CipherContext * context, unsigned char *dest,
89 const unsigned char *src, unsigned int len); 97 const unsigned char *src, unsigned int len);
90 98
91/* If and CRC-32 attack is detected this function is called. Defaults 99/*
92 * to fatal, changed to packet_disconnect in sshd and ssh. */ 100 * If and CRC-32 attack is detected this function is called. Defaults to
93extern void (*cipher_attack_detected) (const char *fmt,...); 101 * fatal, changed to packet_disconnect in sshd and ssh.
102 */
103extern void (*cipher_attack_detected) (const char *fmt, ...);
94 104
95#endif /* CIPHER_H */ 105#endif /* CIPHER_H */