aboutsummaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2018-10-04 15:21:36 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-10-09 13:05:38 +0200
commit72bd2fe1972673ca173cba635472d6e7ad5783d1 (patch)
tree2638bdacd54eab4db36b38ccb2004e1e8792b905 /src/misc.c
parenta2120e168b70218a82617b630e2030ff126a21ec (diff)
downloadlibssh-72bd2fe1972673ca173cba635472d6e7ad5783d1.tar.gz
libssh-72bd2fe1972673ca173cba635472d6e7ad5783d1.tar.xz
libssh-72bd2fe1972673ca173cba635472d6e7ad5783d1.zip
libmbedtls: Support OpenSSH-compatible AES-GCM ciphers using mbedTLS
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/misc.c b/src/misc.c
index cfd971c2..402ece41 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1105,4 +1105,17 @@ char *strndup(const char *s, size_t n)
}
#endif /* ! HAVE_STRNDUP */
+/* Increment 64b integer in network byte order */
+void
+uint64_inc(unsigned char *counter)
+{
+ int i;
+
+ for (i = 7; i >= 0; i--) {
+ counter[i]++;
+ if (counter[i])
+ return;
+ }
+}
+
/** @} */