diff options
author | Jakub Jelen <jjelen@redhat.com> | 2018-11-07 14:49:43 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-01-09 10:14:56 +0100 |
commit | a61368a06a827fb7cf33f2c3a24a621acc56fcc6 (patch) | |
tree | 110cef2a2dd53e36c619d6ae349834312935b1d0 /include | |
parent | 92e978f2f3d4dc2e104a983c1eba4030c722c1c0 (diff) | |
download | libssh-a61368a06a827fb7cf33f2c3a24a621acc56fcc6.tar.gz libssh-a61368a06a827fb7cf33f2c3a24a621acc56fcc6.tar.xz libssh-a61368a06a827fb7cf33f2c3a24a621acc56fcc6.zip |
packet: Prepare counters to handle rekeying limits
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Daiki Ueno <dueno@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/libssh/crypto.h | 5 | ||||
-rw-r--r-- | include/libssh/session.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/libssh/crypto.h b/include/libssh/crypto.h index 0160bafc..16f07325 100644 --- a/include/libssh/crypto.h +++ b/include/libssh/crypto.h @@ -164,6 +164,11 @@ struct ssh_cipher_struct { struct chacha20_poly1305_keysched *chacha20_schedule; unsigned int keysize; /* bytes of key used. != keylen */ size_t tag_size; /* overhead required for tag */ + /* Counters for rekeying initialization */ + uint32_t packets; + uint64_t blocks; + /* Rekeying limit for the cipher or manually enforced */ + uint64_t max_blocks; /* sets the new key for immediate use */ int (*set_encrypt_key)(struct ssh_cipher_struct *cipher, void *key, void *IV); int (*set_decrypt_key)(struct ssh_cipher_struct *cipher, void *key, void *IV); diff --git a/include/libssh/session.h b/include/libssh/session.h index 109cb5f5..fb443b59 100644 --- a/include/libssh/session.h +++ b/include/libssh/session.h @@ -30,6 +30,7 @@ #include "libssh/channels.h" #include "libssh/poll.h" #include "libssh/config.h" +#include "libssh/misc.h" /* These are the different states a SSH session can be into its life */ enum ssh_session_state_e { @@ -113,6 +114,7 @@ struct ssh_session_struct { int openssh; uint32_t send_seq; uint32_t recv_seq; + struct ssh_timestamp last_rekey_time; int connected; /* !=0 when the user got a session handle */ |