diff options
Diffstat (limited to 'cipher.h')
-rw-r--r-- | cipher.h | 23 |
1 files changed, 10 insertions, 13 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cipher.h,v 1.48 2015/07/08 19:09:25 markus Exp $ */ | 1 | /* $OpenBSD: cipher.h,v 1.49 2016/08/03 05:41:57 djm Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -63,14 +63,7 @@ | |||
63 | #define CIPHER_DECRYPT 0 | 63 | #define CIPHER_DECRYPT 0 |
64 | 64 | ||
65 | struct sshcipher; | 65 | struct sshcipher; |
66 | struct sshcipher_ctx { | 66 | struct sshcipher_ctx; |
67 | int plaintext; | ||
68 | int encrypt; | ||
69 | EVP_CIPHER_CTX evp; | ||
70 | struct chachapoly_ctx cp_ctx; /* XXX union with evp? */ | ||
71 | struct aesctr_ctx ac_ctx; /* XXX union with evp? */ | ||
72 | const struct sshcipher *cipher; | ||
73 | }; | ||
74 | 67 | ||
75 | u_int cipher_mask_ssh1(int); | 68 | u_int cipher_mask_ssh1(int); |
76 | const struct sshcipher *cipher_by_name(const char *); | 69 | const struct sshcipher *cipher_by_name(const char *); |
@@ -80,15 +73,15 @@ char *cipher_name(int); | |||
80 | const char *cipher_warning_message(const struct sshcipher_ctx *); | 73 | const char *cipher_warning_message(const struct sshcipher_ctx *); |
81 | int ciphers_valid(const char *); | 74 | int ciphers_valid(const char *); |
82 | char *cipher_alg_list(char, int); | 75 | char *cipher_alg_list(char, int); |
83 | int cipher_init(struct sshcipher_ctx *, const struct sshcipher *, | 76 | int cipher_init(struct sshcipher_ctx **, const struct sshcipher *, |
84 | const u_char *, u_int, const u_char *, u_int, int); | 77 | const u_char *, u_int, const u_char *, u_int, int); |
85 | int cipher_crypt(struct sshcipher_ctx *, u_int, u_char *, const u_char *, | 78 | int cipher_crypt(struct sshcipher_ctx *, u_int, u_char *, const u_char *, |
86 | u_int, u_int, u_int); | 79 | u_int, u_int, u_int); |
87 | int cipher_get_length(struct sshcipher_ctx *, u_int *, u_int, | 80 | int cipher_get_length(struct sshcipher_ctx *, u_int *, u_int, |
88 | const u_char *, u_int); | 81 | const u_char *, u_int); |
89 | int cipher_cleanup(struct sshcipher_ctx *); | 82 | void cipher_free(struct sshcipher_ctx *); |
90 | int cipher_set_key_string(struct sshcipher_ctx *, const struct sshcipher *, | 83 | int cipher_set_key_string(struct sshcipher_ctx **, |
91 | const char *, int); | 84 | const struct sshcipher *, const char *, int); |
92 | u_int cipher_blocksize(const struct sshcipher *); | 85 | u_int cipher_blocksize(const struct sshcipher *); |
93 | u_int cipher_keylen(const struct sshcipher *); | 86 | u_int cipher_keylen(const struct sshcipher *); |
94 | u_int cipher_seclen(const struct sshcipher *); | 87 | u_int cipher_seclen(const struct sshcipher *); |
@@ -96,10 +89,14 @@ u_int cipher_authlen(const struct sshcipher *); | |||
96 | u_int cipher_ivlen(const struct sshcipher *); | 89 | u_int cipher_ivlen(const struct sshcipher *); |
97 | u_int cipher_is_cbc(const struct sshcipher *); | 90 | u_int cipher_is_cbc(const struct sshcipher *); |
98 | 91 | ||
92 | u_int cipher_ctx_is_plaintext(struct sshcipher_ctx *); | ||
93 | u_int cipher_ctx_get_number(struct sshcipher_ctx *); | ||
94 | |||
99 | u_int cipher_get_number(const struct sshcipher *); | 95 | u_int cipher_get_number(const struct sshcipher *); |
100 | int cipher_get_keyiv(struct sshcipher_ctx *, u_char *, u_int); | 96 | int cipher_get_keyiv(struct sshcipher_ctx *, u_char *, u_int); |
101 | int cipher_set_keyiv(struct sshcipher_ctx *, const u_char *); | 97 | int cipher_set_keyiv(struct sshcipher_ctx *, const u_char *); |
102 | int cipher_get_keyiv_len(const struct sshcipher_ctx *); | 98 | int cipher_get_keyiv_len(const struct sshcipher_ctx *); |
103 | int cipher_get_keycontext(const struct sshcipher_ctx *, u_char *); | 99 | int cipher_get_keycontext(const struct sshcipher_ctx *, u_char *); |
104 | void cipher_set_keycontext(struct sshcipher_ctx *, const u_char *); | 100 | void cipher_set_keycontext(struct sshcipher_ctx *, const u_char *); |
101 | |||
105 | #endif /* CIPHER_H */ | 102 | #endif /* CIPHER_H */ |